Fixed size factories may be used in systems with hard realtime requirements and/or predictable memory usage.
concurrency info:
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private ByteBuffer | |
| public static final int | DEFAULT_ALLOCATION_SIZE
default size for internal buffer allocation. |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public static CachedBufferFactory | |
| public static CachedBufferFactory | |
| public static CachedBufferFactory | create(final int initialSize, final boolean
Creates a fixed size factory which will handle overflows (initial size)
with RuntimeExceptions. fixed)Creates a factory with the specified initial size. |
| public static CachedBufferFactory | create(final int initialSize, final int allocationSize)
Creates a factory with the specified initial size and allocation size. |
| public static CachedBufferFactory | |
| public static CachedBufferFactory | |
| public static CachedBufferFactory | createSynchronized(final int initialSize, final boolean fixed)
Synchronized version of |
| public static CachedBufferFactory | createSynchronized(final int initialSize, final int allocationSize)
Synchronized version of |
| public void | |
| public boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. |
| public int | |
| public boolean | isFixed()
Returns true only if this factory does not allow to allocate more buffers as limited by the initial size. |
| public ByteBuffer | |
| public ByteBuffer | |
| public ByteBuffer | |
| public ByteBuffer | |
| public CharBuffer | |
| public CharBuffer | |
| public CharBuffer | |
| public CharBuffer | |
| public DoubleBuffer | |
| public DoubleBuffer | |
| public DoubleBuffer | |
| public DoubleBuffer | |
| public FloatBuffer | |
| public FloatBuffer | |
| public FloatBuffer | |
| public FloatBuffer | |
| public IntBuffer | |
| public IntBuffer | |
| public IntBuffer | |
| public IntBuffer | |
| public LongBuffer | |
| public LongBuffer | |
| public LongBuffer | |
| public LongBuffer | |
| public ShortBuffer | |
| public ShortBuffer | |
| public ShortBuffer | |
| public ShortBuffer | |
| public String |
| ALLOCATION_SIZE | back to summary |
|---|---|
| private final int ALLOCATION_SIZE | |
| currentBuffer | back to summary |
|---|---|
| private ByteBuffer currentBuffer | |
| DEFAULT_ALLOCATION_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_ALLOCATION_SIZE default size for internal buffer allocation. | |
| CachedBufferFactory | back to summary |
|---|---|
| private CachedBufferFactory() | |
| CachedBufferFactory | back to summary |
|---|---|
| private CachedBufferFactory(final int initialSize, final int allocationSize) | |
| checkIfFixed | back to summary |
|---|---|
private void checkIfFixed()
| |
| create | back to summary |
|---|---|
| public static CachedBufferFactory create() Creates a factory with initial size and allocation size set to
| |
| create | back to summary |
|---|---|
| public static CachedBufferFactory create(final int initialSize) Creates a factory with the specified initial size. The allocation size is set to
| |
| create | back to summary |
|---|---|
| public static CachedBufferFactory create(final int initialSize, final boolean fixed) Creates a factory with the specified initial size. The allocation size is set to
| |
| create | back to summary |
|---|---|
| public static CachedBufferFactory create(final int initialSize, final int allocationSize) Creates a factory with the specified initial size and allocation size. | |
| createSynchronized | back to summary |
|---|---|
| public static CachedBufferFactory createSynchronized() Synchronized version of | |
| createSynchronized | back to summary |
|---|---|
| public static CachedBufferFactory createSynchronized(final int initialSize) Synchronized version of | |
| createSynchronized | back to summary |
|---|---|
| public static CachedBufferFactory createSynchronized(final int initialSize, final boolean fixed) Synchronized version of | |
| createSynchronized | back to summary |
|---|---|
| public static CachedBufferFactory createSynchronized(final int initialSize, final int allocationSize) Synchronized version of | |
| destroy | back to summary |
|---|---|
| public void destroy() | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getAllocationSize | back to summary |
|---|---|
| public int getAllocationSize() Returns the allocation size used to create new internal buffers.
0 means that the buffer will not grows, see | |
| isFixed | back to summary |
|---|---|
| public boolean isFixed() Returns true only if this factory does not allow to allocate more buffers as limited by the initial size. | |
| newDirectByteBuffer | back to summary |
|---|---|
| public ByteBuffer newDirectByteBuffer(final int size) | |
| newDirectByteBuffer | back to summary |
|---|---|
| public ByteBuffer newDirectByteBuffer(final byte[] values, final int offset, final int lenght) | |
| newDirectByteBuffer | back to summary |
|---|---|
| public ByteBuffer newDirectByteBuffer(final byte[] values, final int offset) | |
| newDirectByteBuffer | back to summary |
|---|---|
| public ByteBuffer newDirectByteBuffer(final byte[] values) | |
| newDirectCharBuffer | back to summary |
|---|---|
| public CharBuffer newDirectCharBuffer(final int numElements) | |
| newDirectCharBuffer | back to summary |
|---|---|
| public CharBuffer newDirectCharBuffer(final char[] values, final int offset, final int lenght) | |
| newDirectCharBuffer | back to summary |
|---|---|
| public CharBuffer newDirectCharBuffer(final char[] values, final int offset) | |
| newDirectCharBuffer | back to summary |
|---|---|
| public CharBuffer newDirectCharBuffer(final char[] values) | |
| newDirectDoubleBuffer | back to summary |
|---|---|
| public DoubleBuffer newDirectDoubleBuffer(final int numElements) | |
| newDirectDoubleBuffer | back to summary |
|---|---|
| public DoubleBuffer newDirectDoubleBuffer(final double[] values, final int offset, final int lenght) | |
| newDirectDoubleBuffer | back to summary |
|---|---|
| public DoubleBuffer newDirectDoubleBuffer(final double[] values, final int offset) | |
| newDirectDoubleBuffer | back to summary |
|---|---|
| public DoubleBuffer newDirectDoubleBuffer(final double[] values) | |
| newDirectFloatBuffer | back to summary |
|---|---|
| public FloatBuffer newDirectFloatBuffer(final int numElements) | |
| newDirectFloatBuffer | back to summary |
|---|---|
| public FloatBuffer newDirectFloatBuffer(final float[] values, final int offset, final int lenght) | |
| newDirectFloatBuffer | back to summary |
|---|---|
| public FloatBuffer newDirectFloatBuffer(final float[] values, final int offset) | |
| newDirectFloatBuffer | back to summary |
|---|---|
| public FloatBuffer newDirectFloatBuffer(final float[] values) | |
| newDirectIntBuffer | back to summary |
|---|---|
| public IntBuffer newDirectIntBuffer(final int numElements) | |
| newDirectIntBuffer | back to summary |
|---|---|
| public IntBuffer newDirectIntBuffer(final int[] values, final int offset, final int lenght) | |
| newDirectIntBuffer | back to summary |
|---|---|
| public IntBuffer newDirectIntBuffer(final int[] values, final int offset) | |
| newDirectIntBuffer | back to summary |
|---|---|
| public IntBuffer newDirectIntBuffer(final int[] values) | |
| newDirectLongBuffer | back to summary |
|---|---|
| public LongBuffer newDirectLongBuffer(final int numElements) | |
| newDirectLongBuffer | back to summary |
|---|---|
| public LongBuffer newDirectLongBuffer(final long[] values, final int offset, final int lenght) | |
| newDirectLongBuffer | back to summary |
|---|---|
| public LongBuffer newDirectLongBuffer(final long[] values, final int offset) | |
| newDirectLongBuffer | back to summary |
|---|---|
| public LongBuffer newDirectLongBuffer(final long[] values) | |
| newDirectShortBuffer | back to summary |
|---|---|
| public ShortBuffer newDirectShortBuffer(final int numElements) | |
| newDirectShortBuffer | back to summary |
|---|---|
| public ShortBuffer newDirectShortBuffer(final short[] values, final int offset, final int lenght) | |
| newDirectShortBuffer | back to summary |
|---|---|
| public ShortBuffer newDirectShortBuffer(final short[] values, final int offset) | |
| newDirectShortBuffer | back to summary |
|---|---|
| public ShortBuffer newDirectShortBuffer(final short[] values) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized ByteBuffer | newDirectByteBuffer(final int size)
Overrides com. |
| SynchronizedCachedBufferFactory | back to summary |
|---|---|
| private SynchronizedCachedBufferFactory() | |
| SynchronizedCachedBufferFactory | back to summary |
|---|---|
| private SynchronizedCachedBufferFactory(final int size, final int step) | |
| newDirectByteBuffer | back to summary |
|---|---|
| public synchronized ByteBuffer newDirectByteBuffer(final int size) Overrides com.
| |