Package gov.nasa.worldwind.util
Class BufferFactory.ByteBufferFactory
- java.lang.Object
-
- gov.nasa.worldwind.util.BufferFactory
-
- gov.nasa.worldwind.util.BufferFactory.ByteBufferFactory
-
- Enclosing class:
- BufferFactory
public static class BufferFactory.ByteBufferFactory extends BufferFactory
Implementation of BufferFactory which constructs instances ofBufferWrapper.ByteBufferWrapper
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nasa.worldwind.util.BufferFactory
BufferFactory.ByteBufferFactory, BufferFactory.DoubleBufferFactory, BufferFactory.FloatBufferFactory, BufferFactory.IntBufferFactory, BufferFactory.ShortBufferFactory
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BufferWrapper
newBuffer(int size)
Constructs a new ByteBufferWrapper of the specified size, backed by aByteBuffer
.-
Methods inherited from class gov.nasa.worldwind.util.BufferFactory
isAllocateDirect
-
-
-
-
Constructor Detail
-
ByteBufferFactory
public ByteBufferFactory(boolean allocateDirect)
Constructs a new ByteBufferFactory with the specified buffer allocation policy.- Parameters:
allocateDirect
- true to allocate and return ByteBufferWrappers backed by direct buffers, false to allocate and return ByteufferWrappers backed by non-direct buffers.
-
ByteBufferFactory
public ByteBufferFactory()
Constructs a new ByteBufferFactory with the default buffer allocation policy. This factory allocates and returns ByteBufferWrappers backed by direct buffers.
-
-
Method Detail
-
newBuffer
public BufferWrapper newBuffer(int size)
Constructs a new ByteBufferWrapper of the specified size, backed by aByteBuffer
.- Specified by:
newBuffer
in classBufferFactory
- Parameters:
size
- the new buffer's size, int bytes.- Returns:
- the new buffer.
- Throws:
java.lang.IllegalArgumentException
- if size is negative.
-
-