List of utility methods to do Buffer Create
void | copy(Buffer src, Buffer dst, int numElements) Copies the contents of src to dst, starting from the current position of src, copying numElements elements (using the data type of src, no matter the datatype of dst). int numBytes = elementsToBytes(src, numElements);
copyJni(src, positionInBytes(src), dst, positionInBytes(dst),
numBytes);
dst.limit(dst.position() + bytesToElements(dst, numBytes));
|
void | copy(byte[] src, int srcOffset, Buffer dst, int numElements) Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. copyJni(src, srcOffset, dst, positionInBytes(dst), numElements); dst.limit(dst.position() + bytesToElements(dst, numElements)); |
void | copy(char[] src, int srcOffset, Buffer dst, int numElements) Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. copyJni(src, srcOffset << 1, dst, positionInBytes(dst), numElements << 1); dst.limit(dst.position() + bytesToElements(dst, numElements << 1)); |
void | copy(double[] src, int srcOffset, Buffer dst, int numElements) Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. copyJni(src, srcOffset << 3, dst, positionInBytes(dst), numElements << 3); dst.limit(dst.position() + bytesToElements(dst, numElements << 3)); |
void | copy(float[] src, Buffer dst, int numFloats, int offset) Copies numFloats floats from src starting at offset to dst. copyJni(src, dst, numFloats, offset); dst.position(0); if (dst instanceof ByteBuffer) dst.limit(numFloats << 2); else if (dst instanceof FloatBuffer) dst.limit(numFloats); |
void | copy(float[] src, int srcOffset, Buffer dst, int numElements) Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. copyJni(src, srcOffset << 2, dst, positionInBytes(dst), numElements << 2); dst.limit(dst.position() + bytesToElements(dst, numElements << 2)); |
void | copy(int[] src, int srcOffset, Buffer dst, int numElements) Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. copyJni(src, srcOffset << 2, dst, positionInBytes(dst), numElements << 2); dst.limit(dst.position() + bytesToElements(dst, numElements << 2)); |
void | copy(long[] src, int srcOffset, Buffer dst, int numElements) Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. copyJni(src, srcOffset << 3, dst, positionInBytes(dst), numElements << 3); dst.limit(dst.position() + bytesToElements(dst, numElements << 3)); |
void | copy(short[] src, int srcOffset, Buffer dst, int numElements) Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. copyJni(src, srcOffset << 1, dst, positionInBytes(dst), numElements << 1); dst.limit(dst.position() + bytesToElements(dst, numElements << 1)); |