- java.lang.Object
-
- org.eclipse.jetty.io.ByteBufferCallbackAccumulator
-
public class ByteBufferCallbackAccumulator extends java.lang.ObjectThis class can be used to accumulate pairs ofByteBufferandCallback, and eventually copy these into a singleByteBufferor byte array and succeed the callbacks.
-
-
Constructor Summary
Constructors Constructor Description ByteBufferCallbackAccumulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntry(java.nio.ByteBuffer buffer, org.eclipse.jetty.util.Callback callback)voidfail(java.lang.Throwable t)intgetLength()byte[]takeByteArray()voidwriteTo(java.nio.ByteBuffer buffer)
-
-
-
Method Detail
-
addEntry
public void addEntry(java.nio.ByteBuffer buffer, org.eclipse.jetty.util.Callback callback)
-
getLength
public int getLength()
- 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
public void writeTo(java.nio.ByteBuffer buffer)
-
fail
public void fail(java.lang.Throwable t)
-
-