public class AsyncCharDecoder extends AsyncAgent
WhenReady
,
AsyncAgent
,
ByteRingBuffer
,
CharRingBuffer
Constructor and Description |
---|
AsyncCharDecoder(ByteRingBuffer byteRingBuffer,
CharRingBuffer charRingBuffer,
CharsetAsyncOptions charsetAsyncOptions)
Constructs an AsyncCharDecoder instance over the given ring buffers.
|
Modifier and Type | Method and Description |
---|---|
protected void |
action()
"action" function that reads bytes from the input byte ring buffer and writes chars to the output char ring buffer.
|
protected boolean |
done()
"done" predicate that returns true when this async agent wants to quit the current async loop.
|
ByteRingBuffer |
getByteRingBuffer()
Returns the attached byte ring buffer from where bytes will be read.
|
CharRingBuffer |
getCharRingBuffer()
Returns the attached char ring buffer where chars will be written.
|
boolean |
isEOF()
Checks whether this decoder has reached EOF of the input byte ring buffer.
|
protected boolean |
ready()
"ready" predicate that returns true when bytes can be read from the input
byte ring buffer and chars can be written to the output char ring buffer without blocking.
|
applyAsync, isIdle, setIdle, setIdleAndThrow, startApplyLoopAsync
public AsyncCharDecoder(ByteRingBuffer byteRingBuffer, CharRingBuffer charRingBuffer, CharsetAsyncOptions charsetAsyncOptions)
byteRingBuffer
- ByteRingBuffer
to read bytes from.charRingBuffer
- CharRingBuffer
to write chars to.charsetAsyncOptions
- CharsetAsyncOptions
to use for all async operations.public ByteRingBuffer getByteRingBuffer()
public CharRingBuffer getCharRingBuffer()
public boolean isEOF()
protected boolean ready()
ready
in class AsyncAgent
AsyncAgent.action()
.protected boolean done()
done
in class AsyncAgent
protected void action()
action
in class AsyncAgent