Class Stax2Util.ByteAggregator

java.lang.Object
org.codehaus.stax2.ri.Stax2Util.ByteAggregator
Enclosing class:
Stax2Util

public static final class Stax2Util.ByteAggregator extends Object
Helper class for efficiently reading and aggregating variable length byte content.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    addFullBlock(byte[] block)
    Method used to add bufferful of data to the aggregator, and get another buffer to read more data into.
    byte[]
    aggregateAll(byte[] lastBlock, int lastLen)
    Method called when results are finalized and we can get the full aggregated result buffer to return to the caller
    byte[]
    Method called to initialize aggregation process.

    Methods inherited from class java.lang.Object

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

    • ByteAggregator

      public ByteAggregator()
  • Method Details

    • startAggregation

      public byte[] startAggregation()
      Method called to initialize aggregation process.
      Returns:
      Block that can be used to read in content
    • addFullBlock

      public byte[] addFullBlock(byte[] block)
      Method used to add bufferful of data to the aggregator, and get another buffer to read more data into. Returned buffer is generally as big as or bigger than the given buffer, to try to improve performance for larger aggregations.
      Returns:
      Buffer in which to read additional data
    • aggregateAll

      public byte[] aggregateAll(byte[] lastBlock, int lastLen)
      Method called when results are finalized and we can get the full aggregated result buffer to return to the caller