Class ByteBufferCallbackAccumulator
java.lang.Object
org.eclipse.jetty.io.ByteBufferCallbackAccumulator
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntry(ByteBuffer buffer, Callback callback) voidintGet the total length of the content in the accumulator..byte[]voidwriteTo(ByteBuffer buffer)
-
Constructor Details
-
ByteBufferCallbackAccumulator
public ByteBufferCallbackAccumulator()
-
-
Method Details
-
addEntry
-
getLength
public int getLength()Get the total length of the content in the accumulator..- Returns:
- the total length of the content in the accumulator.
-
takeByteArray
public byte[] takeByteArray()- Returns:
- a newly allocated byte array containing all content written into the accumulator.
-
writeTo
-
fail
-