public class CachedBufferFactory extends Object
Fixed size factories may be used in systems with hard realtime requirements and/or predictable memory usage.
concurrency info:
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ALLOCATION_SIZE
default size for internal buffer allocation.
|
Modifier and Type | Method and Description |
---|---|
static CachedBufferFactory |
create()
Creates a factory with initial size and allocation size set to
DEFAULT_ALLOCATION_SIZE . |
static CachedBufferFactory |
create(int initialSize)
Creates a factory with the specified initial size.
|
static CachedBufferFactory |
create(int initialSize,
boolean fixed)
Creates a factory with the specified initial size.
|
static CachedBufferFactory |
create(int initialSize,
int allocationSize)
Creates a factory with the specified initial size and allocation size.
|
static CachedBufferFactory |
createSynchronized()
Synchronized version of
create() . |
static CachedBufferFactory |
createSynchronized(int initialSize)
Synchronized version of
create(int) . |
static CachedBufferFactory |
createSynchronized(int initialSize,
boolean fixed)
Synchronized version of
create(int, boolean) . |
static CachedBufferFactory |
createSynchronized(int initialSize,
int allocationSize)
Synchronized version of
create(int, int) . |
void |
destroy() |
boolean |
equals(Object obj) |
int |
getAllocationSize()
Returns the allocation size used to create new internal buffers.
|
boolean |
isFixed()
Returns true only if this factory does not allow to allocate more buffers
as limited by the initial size.
|
ByteBuffer |
newDirectByteBuffer(byte[] values) |
ByteBuffer |
newDirectByteBuffer(byte[] values,
int offset) |
ByteBuffer |
newDirectByteBuffer(byte[] values,
int offset,
int lenght) |
ByteBuffer |
newDirectByteBuffer(int size) |
CharBuffer |
newDirectCharBuffer(char[] values) |
CharBuffer |
newDirectCharBuffer(char[] values,
int offset) |
CharBuffer |
newDirectCharBuffer(char[] values,
int offset,
int lenght) |
CharBuffer |
newDirectCharBuffer(int numElements) |
DoubleBuffer |
newDirectDoubleBuffer(double[] values) |
DoubleBuffer |
newDirectDoubleBuffer(double[] values,
int offset) |
DoubleBuffer |
newDirectDoubleBuffer(double[] values,
int offset,
int lenght) |
DoubleBuffer |
newDirectDoubleBuffer(int numElements) |
FloatBuffer |
newDirectFloatBuffer(float[] values) |
FloatBuffer |
newDirectFloatBuffer(float[] values,
int offset) |
FloatBuffer |
newDirectFloatBuffer(float[] values,
int offset,
int lenght) |
FloatBuffer |
newDirectFloatBuffer(int numElements) |
IntBuffer |
newDirectIntBuffer(int numElements) |
IntBuffer |
newDirectIntBuffer(int[] values) |
IntBuffer |
newDirectIntBuffer(int[] values,
int offset) |
IntBuffer |
newDirectIntBuffer(int[] values,
int offset,
int lenght) |
LongBuffer |
newDirectLongBuffer(int numElements) |
LongBuffer |
newDirectLongBuffer(long[] values) |
LongBuffer |
newDirectLongBuffer(long[] values,
int offset) |
LongBuffer |
newDirectLongBuffer(long[] values,
int offset,
int lenght) |
ShortBuffer |
newDirectShortBuffer(int numElements) |
ShortBuffer |
newDirectShortBuffer(short[] values) |
ShortBuffer |
newDirectShortBuffer(short[] values,
int offset) |
ShortBuffer |
newDirectShortBuffer(short[] values,
int offset,
int lenght) |
String |
toString() |
public static final int DEFAULT_ALLOCATION_SIZE
public static CachedBufferFactory create()
DEFAULT_ALLOCATION_SIZE
.public static CachedBufferFactory create(int initialSize)
DEFAULT_ALLOCATION_SIZE
.public static CachedBufferFactory create(int initialSize, boolean fixed)
DEFAULT_ALLOCATION_SIZE
.fixed
- Creates a fixed size factory which will handle overflows (initial size)
with RuntimeExceptions.public static CachedBufferFactory create(int initialSize, int allocationSize)
public static CachedBufferFactory createSynchronized()
create()
.public static CachedBufferFactory createSynchronized(int initialSize)
create(int)
.public static CachedBufferFactory createSynchronized(int initialSize, boolean fixed)
create(int, boolean)
.public static CachedBufferFactory createSynchronized(int initialSize, int allocationSize)
create(int, int)
.public boolean isFixed()
public int getAllocationSize()
isFixed()
.public void destroy()
public ByteBuffer newDirectByteBuffer(int size)
public ByteBuffer newDirectByteBuffer(byte[] values, int offset, int lenght)
public ByteBuffer newDirectByteBuffer(byte[] values, int offset)
public ByteBuffer newDirectByteBuffer(byte[] values)
public DoubleBuffer newDirectDoubleBuffer(int numElements)
public DoubleBuffer newDirectDoubleBuffer(double[] values, int offset, int lenght)
public DoubleBuffer newDirectDoubleBuffer(double[] values, int offset)
public DoubleBuffer newDirectDoubleBuffer(double[] values)
public FloatBuffer newDirectFloatBuffer(int numElements)
public FloatBuffer newDirectFloatBuffer(float[] values, int offset, int lenght)
public FloatBuffer newDirectFloatBuffer(float[] values, int offset)
public FloatBuffer newDirectFloatBuffer(float[] values)
public IntBuffer newDirectIntBuffer(int numElements)
public IntBuffer newDirectIntBuffer(int[] values, int offset, int lenght)
public IntBuffer newDirectIntBuffer(int[] values, int offset)
public IntBuffer newDirectIntBuffer(int[] values)
public LongBuffer newDirectLongBuffer(int numElements)
public LongBuffer newDirectLongBuffer(long[] values, int offset, int lenght)
public LongBuffer newDirectLongBuffer(long[] values, int offset)
public LongBuffer newDirectLongBuffer(long[] values)
public ShortBuffer newDirectShortBuffer(int numElements)
public ShortBuffer newDirectShortBuffer(short[] values, int offset, int lenght)
public ShortBuffer newDirectShortBuffer(short[] values, int offset)
public ShortBuffer newDirectShortBuffer(short[] values)
public CharBuffer newDirectCharBuffer(int numElements)
public CharBuffer newDirectCharBuffer(char[] values, int offset, int lenght)
public CharBuffer newDirectCharBuffer(char[] values, int offset)
public CharBuffer newDirectCharBuffer(char[] values)