Class ChunkAccumulator

java.lang.Object
org.eclipse.jetty.io.ChunkAccumulator

@Deprecated(forRemoval=true, since="12.1.0") public class ChunkAccumulator extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
An accumulator of Content.Chunks used to facilitate minimal copy aggregation of multiple chunks.
  • Constructor Details

    • ChunkAccumulator

      public ChunkAccumulator()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • add

      public boolean add(Content.Chunk chunk)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a Content.Chunk to the accumulator.
      Parameters:
      chunk - The Content.Chunk to accumulate. If a reference is kept to the chunk (rather than a copy), it will be retained.
      Returns:
      true if the Content.Chunk had content and was added to the accumulator.
      Throws:
      ArithmeticException - if more that Integer.MAX_VALUE bytes are added.
      IllegalArgumentException - if the passed Content.Chunk is a failure.
    • length

      public int length()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the total length of the accumulated Content.Chunks.
      Returns:
      The total length in bytes.
    • take

      public byte[] take()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • take

      public RetainableByteBuffer take(ByteBufferPool pool, boolean direct)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • close

      public void close()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • readAll

      @Deprecated(forRemoval=true, since="12.0.15") public CompletableFuture<byte[]> readAll(Content.Source source)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • readAll

      @Deprecated(forRemoval=true, since="12.0.15") public CompletableFuture<byte[]> readAll(Content.Source source, int maxSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • readAll

      @Deprecated(forRemoval=true, since="12.0.15") public CompletableFuture<RetainableByteBuffer> readAll(Content.Source source, ByteBufferPool pool, boolean direct, int maxSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      source - The Content.Source to read
      pool - The ByteBufferPool to acquire the buffer from, or null for a non Retainable buffer
      direct - True if the buffer should be direct.
      maxSize - The maximum size to read, or -1 for no limit
      Returns:
      A CompletableFuture that will be completed when the complete content is read or failed if the max size is exceeded or there is a read error.