This class can be used to accumulate pairs of ByteBuffer and Callback, and eventually copy
these into a single ByteBuffer or byte array and succeed the callbacks.
This class is not thread safe and callers must do mutual exclusion.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public int | Returns: the total length of the content in the accumulator.Get the total length of the content in the accumulator.. |
| public byte[] | Returns: a newly allocated byte array containing all content written into the accumulator.
|
| public void |
| _entries | back to summary |
|---|---|
| private final List<ByteBufferCallbackAccumulator. | |
| _length | back to summary |
|---|---|
| private int _length | |
| ByteBufferCallbackAccumulator | back to summary |
|---|---|
| public ByteBufferCallbackAccumulator() | |
| addEntry | back to summary |
|---|---|
| public void addEntry(ByteBuffer buffer, Callback callback) | |
| fail | back to summary |
|---|---|
| public void fail(Throwable t) | |
| getLength | back to summary |
|---|---|
| public int getLength() Get the total length of the content in the accumulator..
| |
| takeByteArray | back to summary |
|---|---|
public byte[] takeByteArray()
| |
| writeTo | back to summary |
|---|---|
| public void writeTo(ByteBuffer buffer) | |
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBuffer | |
| private final Callback |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| buffer | back to summary |
|---|---|
| private final ByteBuffer buffer | |
| callback | back to summary |
|---|---|
| private final Callback callback | |
| Entry | back to summary |
|---|---|
| pack-priv Entry(ByteBuffer buffer, Callback callback) | |