public final class DataBuffers extends Object
DataBuffer instances.| Constructor and Description |
|---|
DataBuffers() |
| Modifier and Type | Method and Description |
|---|---|
static BooleanDataBuffer |
of(boolean... values)
Create a buffer from an array of booleans into a data buffer.
|
static BooleanDataBuffer |
of(boolean[] array,
boolean readOnly,
boolean makeCopy)
Create a buffer from an array of booleans into a data buffer.
|
static ByteDataBuffer |
of(byte... values)
Create a buffer from an array of bytes into a data buffer.
|
static ByteDataBuffer |
of(byte[] array,
boolean readOnly,
boolean makeCopy)
Create a buffer from an array of bytes into a data buffer.
|
static ByteDataBuffer |
of(ByteBuffer buf)
Wraps a JDK NIO
ByteBuffer into a data buffer. |
static DoubleDataBuffer |
of(double... values)
Create a buffer from an array of doubles into a data buffer.
|
static DoubleDataBuffer |
of(double[] array,
boolean readOnly,
boolean makeCopy)
Create a buffer from an array of doubles into a data buffer.
|
static DoubleDataBuffer |
of(DoubleBuffer buf)
Wraps a JDK NIO
DoubleBuffer into a data buffer. |
static FloatDataBuffer |
of(float... values)
Create a buffer from an array of floats into a data buffer.
|
static FloatDataBuffer |
of(float[] array,
boolean readOnly,
boolean makeCopy)
Create a buffer from an array of floats into a data buffer.
|
static FloatDataBuffer |
of(FloatBuffer buf)
Wraps a JDK NIO
FloatBuffer into a data buffer. |
static IntDataBuffer |
of(int... values)
Create a buffer from an array of ints into a data buffer.
|
static IntDataBuffer |
of(int[] array,
boolean readOnly,
boolean makeCopy)
Create a buffer from an array of ints into a data buffer.
|
static IntDataBuffer |
of(IntBuffer buf)
Wraps a JDK NIO
IntBuffer into a data buffer. |
static LongDataBuffer |
of(long... values)
Create a buffer from an array of longs into a data buffer.
|
static LongDataBuffer |
of(long[] array,
boolean readOnly,
boolean makeCopy)
Create a buffer from an array of longs into a data buffer.
|
static LongDataBuffer |
of(LongBuffer buf)
Wraps a JDK NIO
LongBuffer into a data buffer. |
static ShortDataBuffer |
of(short... values)
Create a buffer from an array of shorts into a data buffer.
|
static ShortDataBuffer |
of(short[] array,
boolean readOnly,
boolean makeCopy)
Create a buffer from an array of shorts into a data buffer.
|
static ShortDataBuffer |
of(ShortBuffer buf)
Wraps a JDK NIO
ShortBuffer into a data buffer. |
static <T> DataBuffer<T> |
of(T[] array,
boolean readOnly,
boolean makeCopy)
Create a buffer from an array of objects into a data buffer.
|
static BooleanDataBuffer |
ofBooleans(long size)
Creates a buffer of booleans that can store up to
size values |
static ByteDataBuffer |
ofBytes(long size)
Creates a buffer of bytes that can store up to
size values |
static DoubleDataBuffer |
ofDoubles(long size)
Creates a buffer of doubles that can store up to
size values |
static FloatDataBuffer |
ofFloats(long size)
Creates a buffer of floats that can store up to
size values |
static IntDataBuffer |
ofInts(long size)
Creates a buffer of integers that can store up to
size values |
static LongDataBuffer |
ofLongs(long size)
Creates a buffer of longs that can store up to
size values |
static <T> DataBuffer<T> |
ofObjects(Class<T> type,
long size)
Creates a buffer of references to objects of type
clazz` that can store up to `size
values. |
static <T> DataBuffer<T> |
ofObjects(T... values)
Create a buffer from an array of objects into a data buffer.
|
static ShortDataBuffer |
ofShorts(long size)
Creates a buffer of shorts that can store up to
size values |
public static ByteDataBuffer ofBytes(long size)
size valuessize - size of the buffer to allocatepublic static LongDataBuffer ofLongs(long size)
size valuessize - size of the buffer to allocatepublic static IntDataBuffer ofInts(long size)
size valuessize - size of the buffer to allocatepublic static ShortDataBuffer ofShorts(long size)
size valuessize - size of the buffer to allocatepublic static DoubleDataBuffer ofDoubles(long size)
size valuessize - size of the buffer to allocatepublic static FloatDataBuffer ofFloats(long size)
size valuessize - size of the buffer to allocatepublic static BooleanDataBuffer ofBooleans(long size)
size valuessize - size of the buffer to allocatepublic static <T> DataBuffer<T> ofObjects(Class<T> type, long size)
clazz` that can store up to `size
values.T - data typetype - the type of object stored in this buffersize - size of the buffer to allocatepublic static FloatDataBuffer of(float... values)
The returned buffer allows read and write operations and share the memory of the source
array, which is equivalent to call of(values, false, false}
values - float valuespublic static ByteDataBuffer of(byte... values)
The returned buffer allows read and write operations and share the memory of the source
array, which is equivalent to call of(values, false, false}
values - byte valuespublic static LongDataBuffer of(long... values)
The returned buffer allows read and write operations and share the memory of the source
array, which is equivalent to call of(values, false, false}
values - long valuespublic static IntDataBuffer of(int... values)
The returned buffer allows read and write operations and share the memory of the source
array, which is equivalent to call of(values, false, false}
values - int valuespublic static ShortDataBuffer of(short... values)
The returned buffer allows read and write operations and share the memory of the source
array, which is equivalent to call of(values, false, false}
values - short valuespublic static DoubleDataBuffer of(double... values)
The returned buffer allows read and write operations and share the memory of the source
array, which is equivalent to call of(array, false, false}
values - double valuespublic static BooleanDataBuffer of(boolean... values)
The returned buffer allows read and write operations and share the memory of the source
array, which is equivalent to call of(values, false, false}
values - booleans values@SafeVarargs public static <T> DataBuffer<T> ofObjects(T... values)
The returned buffer allows read and write operations and share the memory of the source
array, which is equivalent to call of(values, false, false}
T - data typevalues - objects valuespublic static FloatDataBuffer of(float[] array, boolean readOnly, boolean makeCopy)
array - array of floatsreadOnly - true if the buffer created must be read-onlymakeCopy - true if the array must be copied, false will wrap the provided arraypublic static ByteDataBuffer of(byte[] array, boolean readOnly, boolean makeCopy)
array - array of bytesreadOnly - true if the buffer created must be read-onlymakeCopy - true if the array must be copied, false will wrap the provided arraypublic static LongDataBuffer of(long[] array, boolean readOnly, boolean makeCopy)
array - array of longsreadOnly - true if the buffer created must be read-onlymakeCopy - true if the array must be copied, false will wrap the provided arraypublic static IntDataBuffer of(int[] array, boolean readOnly, boolean makeCopy)
array - array of intsreadOnly - true if the buffer created must be read-onlymakeCopy - true if the array must be copied, false will wrap the provided arraypublic static ShortDataBuffer of(short[] array, boolean readOnly, boolean makeCopy)
array - array of shortsreadOnly - true if the buffer created must be read-onlymakeCopy - true if the array must be copied, false will wrap the provided arraypublic static DoubleDataBuffer of(double[] array, boolean readOnly, boolean makeCopy)
array - array of doublesreadOnly - true if the buffer created must be read-onlymakeCopy - true if the array must be copied, false will wrap the provided arraypublic static BooleanDataBuffer of(boolean[] array, boolean readOnly, boolean makeCopy)
array - array of booleansreadOnly - true if the buffer created must be read-onlymakeCopy - true if the array must be copied, false will wrap the provided arraypublic static <T> DataBuffer<T> of(T[] array, boolean readOnly, boolean makeCopy)
T - data typearray - array of objectsreadOnly - true if the buffer created must be read-onlymakeCopy - true if the array must be copied, false will wrap the provided arraypublic static ByteDataBuffer of(ByteBuffer buf)
ByteBuffer into a data buffer.buf - buffer to wrappublic static IntDataBuffer of(IntBuffer buf)
IntBuffer into a data buffer.buf - buffer to wrappublic static ShortDataBuffer of(ShortBuffer buf)
ShortBuffer into a data buffer.buf - buffer to wrappublic static LongDataBuffer of(LongBuffer buf)
LongBuffer into a data buffer.buf - buffer to wrappublic static FloatDataBuffer of(FloatBuffer buf)
FloatBuffer into a data buffer.buf - buffer to wrappublic static DoubleDataBuffer of(DoubleBuffer buf)
DoubleBuffer into a data buffer.buf - buffer to wrapCopyright © 2015–2020. All rights reserved.