public static final class Stax2Util.ByteAggregator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static int |
DEFAULT_BLOCK_ARRAY_SIZE
Maximum block size we will use for individual non-aggregated
blocks.
|
private static int |
INITIAL_BLOCK_SIZE
Size of the first block we will allocate.
|
private int |
mBlockCount |
private byte[][] |
mBlocks |
private byte[] |
mSpareBlock
Reusable byte buffer block; we retain biggest one from
mBlocks after aggregation. |
private int |
mTotalLen |
private static byte[] |
NO_BYTES |
Constructor and Description |
---|
ByteAggregator() |
Modifier and Type | Method and 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[] |
startAggregation()
Method called to initialize aggregation process.
|
private static final byte[] NO_BYTES
private static final int INITIAL_BLOCK_SIZE
static final int DEFAULT_BLOCK_ARRAY_SIZE
private byte[][] mBlocks
private int mBlockCount
private int mTotalLen
private byte[] mSpareBlock
mBlocks
after aggregation.public byte[] startAggregation()
public byte[] addFullBlock(byte[] block)
public byte[] aggregateAll(byte[] lastBlock, int lastLen)