Class DataBuffers
DataBuffer instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BooleanDataBufferof(boolean... values) Create a buffer from an array of booleans into a data buffer.static BooleanDataBufferof(boolean[] array, boolean readOnly, boolean makeCopy) Create a buffer from an array of booleans into a data buffer.static ByteDataBufferof(byte... values) Create a buffer from an array of bytes into a data buffer.static ByteDataBufferof(byte[] array, boolean readOnly, boolean makeCopy) Create a buffer from an array of bytes into a data buffer.static DoubleDataBufferof(double... values) Create a buffer from an array of doubles into a data buffer.static DoubleDataBufferof(double[] array, boolean readOnly, boolean makeCopy) Create a buffer from an array of doubles into a data buffer.static FloatDataBufferof(float... values) Create a buffer from an array of floats into a data buffer.static FloatDataBufferof(float[] array, boolean readOnly, boolean makeCopy) Create a buffer from an array of floats into a data buffer.static IntDataBufferof(int... values) Create a buffer from an array of ints into a data buffer.static IntDataBufferof(int[] array, boolean readOnly, boolean makeCopy) Create a buffer from an array of ints into a data buffer.static LongDataBufferof(long... values) Create a buffer from an array of longs into a data buffer.static LongDataBufferof(long[] array, boolean readOnly, boolean makeCopy) Create a buffer from an array of longs into a data buffer.static ShortDataBufferof(short... values) Create a buffer from an array of shorts into a data buffer.static ShortDataBufferof(short[] array, boolean readOnly, boolean makeCopy) Create a buffer from an array of shorts into a data buffer.static ByteDataBufferof(ByteBuffer buf) Wraps a JDK NIOByteBufferinto a data buffer.static DoubleDataBufferof(DoubleBuffer buf) Wraps a JDK NIODoubleBufferinto a data buffer.static FloatDataBufferof(FloatBuffer buf) Wraps a JDK NIOFloatBufferinto a data buffer.static IntDataBufferWraps a JDK NIOIntBufferinto a data buffer.static LongDataBufferof(LongBuffer buf) Wraps a JDK NIOLongBufferinto a data buffer.static ShortDataBufferof(ShortBuffer buf) Wraps a JDK NIOShortBufferinto 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 BooleanDataBufferofBooleans(long size) Creates a buffer of booleans that can store up tosizevaluesstatic ByteDataBufferofBytes(long size) Creates a buffer of bytes that can store up tosizevaluesstatic DoubleDataBufferofDoubles(long size) Creates a buffer of doubles that can store up tosizevaluesstatic FloatDataBufferofFloats(long size) Creates a buffer of floats that can store up tosizevaluesstatic IntDataBufferofInts(long size) Creates a buffer of integers that can store up tosizevaluesstatic LongDataBufferofLongs(long size) Creates a buffer of longs that can store up tosizevaluesstatic <T> DataBuffer<T> Creates a buffer of references to objects of typeclazz` that can store up to `sizevalues.static <T> DataBuffer<T> ofObjects(T... values) Create a buffer from an array of objects into a data buffer.static ShortDataBufferofShorts(long size) Creates a buffer of shorts that can store up tosizevalues
-
Constructor Details
-
DataBuffers
public DataBuffers()
-
-
Method Details
-
ofBytes
Creates a buffer of bytes that can store up tosizevalues- Parameters:
size- size of the buffer to allocate- Returns:
- a new buffer
-
ofLongs
Creates a buffer of longs that can store up tosizevalues- Parameters:
size- size of the buffer to allocate- Returns:
- a new buffer
-
ofInts
Creates a buffer of integers that can store up tosizevalues- Parameters:
size- size of the buffer to allocate- Returns:
- a new buffer
-
ofShorts
Creates a buffer of shorts that can store up tosizevalues- Parameters:
size- size of the buffer to allocate- Returns:
- a new buffer
-
ofDoubles
Creates a buffer of doubles that can store up tosizevalues- Parameters:
size- size of the buffer to allocate- Returns:
- a new buffer
-
ofFloats
Creates a buffer of floats that can store up tosizevalues- Parameters:
size- size of the buffer to allocate- Returns:
- a new buffer
-
ofBooleans
Creates a buffer of booleans that can store up tosizevalues- Parameters:
size- size of the buffer to allocate- Returns:
- a new buffer
-
ofObjects
Creates a buffer of references to objects of typeclazz` that can store up to `sizevalues.- Type Parameters:
T- data type- Parameters:
type- the type of object stored in this buffersize- size of the buffer to allocate- Returns:
- a new buffer
-
of
Create a buffer from an array of floats into a data buffer.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}- Parameters:
values- float values- Returns:
- a new buffer
-
of
Create a buffer from an array of bytes into a data buffer.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}- Parameters:
values- byte values- Returns:
- a new buffer
-
of
Create a buffer from an array of longs into a data buffer.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}- Parameters:
values- long values- Returns:
- a new buffer
-
of
Create a buffer from an array of ints into a data buffer.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}- Parameters:
values- int values- Returns:
- a new buffer
-
of
Create a buffer from an array of shorts into a data buffer.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}- Parameters:
values- short values- Returns:
- a new buffer
-
of
Create a buffer from an array of doubles into a data buffer.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}- Parameters:
values- double values- Returns:
- a new buffer
-
of
Create a buffer from an array of booleans into a data buffer.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}- Parameters:
values- booleans values- Returns:
- a new buffer
-
ofObjects
Create a buffer from an array of objects into a data buffer.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}- Type Parameters:
T- data type- Parameters:
values- objects values- Returns:
- a new buffer
-
of
Create a buffer from an array of floats into a data buffer.- Parameters:
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 array- Returns:
- a new buffer
-
of
Create a buffer from an array of bytes into a data buffer.- Parameters:
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 array- Returns:
- a new buffer
-
of
Create a buffer from an array of longs into a data buffer.- Parameters:
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 array- Returns:
- a new buffer
-
of
Create a buffer from an array of ints into a data buffer.- Parameters:
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 array- Returns:
- a new buffer
-
of
Create a buffer from an array of shorts into a data buffer.- Parameters:
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 array- Returns:
- a new buffer
-
of
Create a buffer from an array of doubles into a data buffer.- Parameters:
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 array- Returns:
- a new buffer
-
of
Create a buffer from an array of booleans into a data buffer.- Parameters:
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 array- Returns:
- a new buffer
-
of
Create a buffer from an array of objects into a data buffer.- Type Parameters:
T- data type- Parameters:
array- array of objectsreadOnly- true if the buffer created must be read-onlymakeCopy- true if the array must be copied, false will wrap the provided array- Returns:
- a new buffer
-
of
Wraps a JDK NIOByteBufferinto a data buffer.- Parameters:
buf- buffer to wrap- Returns:
- a new buffer
-
of
Wraps a JDK NIOIntBufferinto a data buffer.- Parameters:
buf- buffer to wrap- Returns:
- a new buffer
-
of
Wraps a JDK NIOShortBufferinto a data buffer.- Parameters:
buf- buffer to wrap- Returns:
- a new buffer
-
of
Wraps a JDK NIOLongBufferinto a data buffer.- Parameters:
buf- buffer to wrap- Returns:
- a new buffer
-
of
Wraps a JDK NIOFloatBufferinto a data buffer.- Parameters:
buf- buffer to wrap- Returns:
- a new buffer
-
of
Wraps a JDK NIODoubleBufferinto a data buffer.- Parameters:
buf- buffer to wrap- Returns:
- a new buffer
-