Class BufferRecycler
java.lang.Object
org.codehaus.jackson.util.BufferRecycler
This is a small utility class, whose main functionality is to allow
simple reuse of raw byte/char buffers. It is usually used through
ThreadLocal member of the owning class pointing to
instance of this class through a SoftReference. The
end result is a low-overhead GC-cleanable recycling: hopefully
ideal for use by stream readers.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final byte[][]protected final char[][]static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal byte[]final char[]final char[]allocCharBuffer(BufferRecycler.CharBufferType type, int minSize) final voidreleaseByteBuffer(BufferRecycler.ByteBufferType type, byte[] buffer) final voidreleaseCharBuffer(BufferRecycler.CharBufferType type, char[] buffer)
-
Field Details
-
DEFAULT_WRITE_CONCAT_BUFFER_LEN
public static final int DEFAULT_WRITE_CONCAT_BUFFER_LEN- See Also:
-
_byteBuffers
protected final byte[][] _byteBuffers -
_charBuffers
protected final char[][] _charBuffers
-
-
Constructor Details
-
BufferRecycler
public BufferRecycler()
-
-
Method Details
-
allocByteBuffer
-
releaseByteBuffer
-
allocCharBuffer
-
allocCharBuffer
-
releaseCharBuffer
-