public abstract class BaseOutputReader extends BaseDataReader
Modifier and Type | Class and Description |
---|---|
static class |
BaseOutputReader.Options
See
#BaseOutputReader(Reader, Options) , BaseDataReader.readAvailable() , BaseDataReader.SleepingPolicy
and processInput(char[], java.lang.StringBuilder, int) for reference. |
BaseDataReader.AdaptiveSleepingPolicy, BaseDataReader.SleepingPolicy
Modifier and Type | Field and Description |
---|---|
protected java.io.Reader |
myReader |
isStopped, mySleepingPolicy, mySleepMonitor
Constructor and Description |
---|
BaseOutputReader(java.io.InputStream inputStream,
java.nio.charset.Charset charset) |
BaseOutputReader(java.io.InputStream inputStream,
java.nio.charset.Charset charset,
BaseOutputReader.Options options) |
BaseOutputReader(java.io.Reader reader) |
BaseOutputReader(java.io.Reader reader,
BaseDataReader.SleepingPolicy policy)
Deprecated.
|
BaseOutputReader(java.io.Reader reader,
BaseOutputReader.Options options) |
Modifier and Type | Method and Description |
---|---|
protected void |
close() |
protected void |
flush() |
protected abstract void |
onTextAvailable(java.lang.String text) |
protected boolean |
readAvailableBlocking()
Reads data with blocking.
|
protected boolean |
readAvailableNonBlocking()
Reads as much data as possible without blocking.
|
beforeSleeping, doRun, executeOnPooledThread, readAvailable, start, start, stop, waitFor, waitFor
public BaseOutputReader(java.io.InputStream inputStream, java.nio.charset.Charset charset)
public BaseOutputReader(java.io.InputStream inputStream, java.nio.charset.Charset charset, BaseOutputReader.Options options)
public BaseOutputReader(java.io.Reader reader)
public BaseOutputReader(java.io.Reader reader, BaseOutputReader.Options options)
@Deprecated public BaseOutputReader(java.io.Reader reader, BaseDataReader.SleepingPolicy policy)
BaseOutputReader(Reader, Options)
protected final boolean readAvailableNonBlocking() throws java.io.IOException
readAvailableBlocking()
.readAvailableNonBlocking
in class BaseDataReader
java.io.IOException
- If an I/O error occursBaseDataReader.SleepingPolicy.NON_BLOCKING
protected final boolean readAvailableBlocking() throws java.io.IOException
Reader.ready()
method always returns false
for your input stream.
Should be used if we want to make our reader exit when the end of a stream is reached.
Could be used if we prefer IO-blocking over CPU sleeping.readAvailableBlocking
in class BaseDataReader
java.io.IOException
- If an I/O error occursBaseDataReader.SleepingPolicy.BLOCKING
protected void flush()
flush
in class BaseDataReader
protected void close() throws java.io.IOException
close
in class BaseDataReader
java.io.IOException
protected abstract void onTextAvailable(java.lang.String text)