Class ByteBufferCallbackAccumulator


  • public class ByteBufferCallbackAccumulator
    extends java.lang.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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addEntry​(java.nio.ByteBuffer buffer, org.eclipse.jetty.util.Callback callback)  
      void fail​(java.lang.Throwable t)  
      int getLength()  
      byte[] takeByteArray()  
      void writeTo​(java.nio.ByteBuffer buffer)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ByteBufferCallbackAccumulator

        public ByteBufferCallbackAccumulator()
    • 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)