DataBufferFactory interface. Allows for
specification of the default initial capacity at construction time, as well
as whether heap-based or direct buffers are to be preferred.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | DEFAULT_INITIAL_CAPACITY
The default capacity when none is specified. |
| private final int | |
| private final boolean | |
| public static final DefaultDataBufferFactory | sharedInstance
Shared instance based on the default constructor. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DefaultDataBufferFactory(boolean
true if direct buffers are to be preferred;
false otherwiseCreates a new |
| public | DefaultDataBufferFactory(boolean
true if direct buffers are to be preferred;
false otherwiseCreates a new |
| Modifier and Type | Method and Description |
|---|---|
| public DefaultDataBuffer | allocateBuffer()
Implements org.
Deprecated
Allocate a data buffer of a default initial capacity.
|
| public DefaultDataBuffer | allocateBuffer(int
the initial capacity of the buffer to allocate initialCapacity)Implements org. |
| public boolean | isDirect()
Implements org. |
| public DefaultDataBuffer | join(List<? extends DataBuffer>
the data buffers to be composed dataBuffers)Implements org. DataBuffer composed of the dataBuffers elements joined together.
|
| public String | |
| public DefaultDataBuffer | wrap(ByteBuffer
the NIO byte buffer to wrap byteBuffer)Implements org. ByteBuffer in a DataBuffer.
|
| public DefaultDataBuffer | wrap(byte[]
the byte array to wrap bytes)Implements org. byte array in a DataBuffer.
|
| DEFAULT_INITIAL_CAPACITY | back to summary |
|---|---|
| public static final int DEFAULT_INITIAL_CAPACITY The default capacity when none is specified. | |
| defaultInitialCapacity | back to summary |
|---|---|
| private final int defaultInitialCapacity | |
| preferDirect | back to summary |
|---|---|
| private final boolean preferDirect | |
| sharedInstance | back to summary |
|---|---|
| public static final DefaultDataBufferFactory sharedInstance Shared instance based on the default constructor.
| |
| DefaultDataBufferFactory | back to summary |
|---|---|
| public DefaultDataBufferFactory() Creates a new
| |
| DefaultDataBufferFactory | back to summary |
|---|---|
| public DefaultDataBufferFactory(boolean preferDirect) Creates a new
| |
| DefaultDataBufferFactory | back to summary |
|---|---|
| public DefaultDataBufferFactory(boolean preferDirect, int defaultInitialCapacity) Creates a new
| |
| allocateBuffer | back to summary |
|---|---|
| public DefaultDataBuffer allocateBuffer() Implements org. Doc from org. Deprecated
Allocate a data buffer of a default initial capacity. Depending on the underlying implementation and its configuration, this will be heap-based or direct buffer.
| |
| allocateBuffer | back to summary |
|---|---|
| public DefaultDataBuffer allocateBuffer(int initialCapacity) Implements org. Doc from org. Allocate a data buffer of the given initial capacity. Depending on the underlying implementation and its configuration, this will be heap-based or direct buffer.
| |
| isDirect | back to summary |
|---|---|
| public boolean isDirect() Implements org. Doc from org. Indicates whether this factory allocates direct buffers (i.e. non-heap, native memory).
| |
| join | back to summary |
|---|---|
| public DefaultDataBuffer join(List<? extends DataBuffer> dataBuffers) Implements org. Doc from org. Return a new Note that the given data buffers do not have to be released, as they are released as part of the returned composite. This implementation creates a single
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| wrap | back to summary |
|---|---|
| public DefaultDataBuffer wrap(ByteBuffer byteBuffer) Implements org. Doc from org. Wrap the given
| |
| wrap | back to summary |
|---|---|
| public DefaultDataBuffer wrap(byte[] bytes) Implements org. Doc from org. Wrap the given
| |