public final class ResponseChunk extends Object
Data are represented as a readable ByteBuffer. The ByteBuffer can be reused when release() method
is called.
Each chunk can request to be flushed or not.
| Constructor | Description |
|---|---|
ResponseChunk(boolean flush,
ByteBuffer data) |
Creates new instance.
|
ResponseChunk(boolean flush,
ByteBuffer data,
Runnable releaseCallback) |
Creates new instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
ByteBuffer |
data() |
Returns a data.
|
boolean |
flush() |
Returns
true if all caches are requested to flush when this chunk is written. |
void |
release() |
Call when data were consumed and data buffer can be reused.
|
public ResponseChunk(boolean flush,
ByteBuffer data,
Runnable releaseCallback)
flush - a signal that chunk should be written and flushed from any cache if possibledata - a data chunk. Should not be reused until releaseCallback is usedreleaseCallback - a callback which is called when this chunk is completely processed and instance is free for reusepublic ResponseChunk(boolean flush,
ByteBuffer data)
flush - a signal that chunk should be written and flushed from any cache if possibledata - a data chunk. Should not be reused until releaseCallback is usedpublic void release()
public ByteBuffer data()
public boolean flush()
true if all caches are requested to flush when this chunk is written.true if it is requested to flush all caches after this chunkCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.