Class PrimitiveArrayBuilder<T>
java.lang.Object
tools.jackson.databind.util.PrimitiveArrayBuilder<T>
- Direct Known Subclasses:
ArrayBuilders.BooleanBuilder, ArrayBuilders.ByteBuilder, ArrayBuilders.DoubleBuilder, ArrayBuilders.FloatBuilder, ArrayBuilders.IntBuilder, ArrayBuilders.LongBuilder, ArrayBuilders.ShortBuilder
Base class for specialized primitive array builders.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classFor actual buffering beyond the current buffer, we can actually use shared class which only deals with opaque "untyped" chunks. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intNumber of total buffered entries in this buffer, counting all instances within linked list formed by following_bufferHead.protected PrimitiveArrayBuilder.Node<T> protected PrimitiveArrayBuilder.Node<T> protected T(package private) static final intLet's start with small chunks; typical usage is for small arrays anyway.(package private) static final intLet's limit maximum size of chunks we use; helps avoid excessive allocation overhead for huge data sets.(package private) static final intAlso: let's expand by doubling up until 64k chunks (which is 16k entries for 32-bit machines) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract T_constructArray(int len) protected void_reset()final TappendCompletedChunk(T fullChunk, int fullChunkLength) intcompleteAndClearBuffer(T lastChunk, int lastChunkEntries)
-
Field Details
-
INITIAL_CHUNK_SIZE
static final int INITIAL_CHUNK_SIZELet's start with small chunks; typical usage is for small arrays anyway.- See Also:
-
SMALL_CHUNK_SIZE
static final int SMALL_CHUNK_SIZEAlso: let's expand by doubling up until 64k chunks (which is 16k entries for 32-bit machines)- See Also:
-
MAX_CHUNK_SIZE
static final int MAX_CHUNK_SIZELet's limit maximum size of chunks we use; helps avoid excessive allocation overhead for huge data sets. For now, let's limit to quarter million entries, 1 meg chunks for 32-bit machines.- See Also:
-
_freeBuffer
-
_bufferHead
-
_bufferTail
-
_bufferedEntryCount
protected int _bufferedEntryCountNumber of total buffered entries in this buffer, counting all instances within linked list formed by following_bufferHead.
-
-
Constructor Details
-
PrimitiveArrayBuilder
protected PrimitiveArrayBuilder()
-
-
Method Details
-
bufferedSize
public int bufferedSize() -
resetAndStart
-
appendCompletedChunk
-
completeAndClearBuffer
-
_constructArray
-
_reset
protected void _reset()
-