Class ByteBufferCallbackAccumulator


public class ByteBufferCallbackAccumulator extends Object
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.
  • Constructor Details

    • ByteBufferCallbackAccumulator

      public ByteBufferCallbackAccumulator()
  • Method Details

    • addEntry

      public void addEntry(ByteBuffer buffer, Callback callback)
    • getLength

      public int getLength()
      the total length of the content in the accumulator.
    • takeByteArray

      public byte[] takeByteArray()
      a newly allocated byte array containing all content written into the accumulator.
    • writeTo

      public void writeTo(ByteBuffer buffer)
    • fail

      public void fail(Throwable t)