public static class BufferFactory.ByteBufferFactory extends BufferFactory
BufferWrapper.ByteBufferWrapperBufferFactory.ByteBufferFactory, BufferFactory.DoubleBufferFactory, BufferFactory.FloatBufferFactory, BufferFactory.IntBufferFactory, BufferFactory.ShortBufferFactory| Constructor and Description |
|---|
ByteBufferFactory()
Constructs a new ByteBufferFactory with the default buffer allocation policy.
|
ByteBufferFactory(boolean allocateDirect)
Constructs a new ByteBufferFactory with the specified buffer allocation policy.
|
| Modifier and Type | Method and Description |
|---|---|
BufferWrapper |
newBuffer(int size)
Constructs a new ByteBufferWrapper of the specified size, backed by a
ByteBuffer. |
isAllocateDirectpublic ByteBufferFactory()
public ByteBufferFactory(boolean allocateDirect)
allocateDirect - true to allocate and return ByteBufferWrappers backed by direct buffers, false to
allocate and return ByteufferWrappers backed by non-direct buffers.public BufferWrapper newBuffer(int size)
ByteBuffer.newBuffer in class BufferFactorysize - the new buffer's size, int bytes.IllegalArgumentException - if size is negative.