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