Android Utililty Methods Buffer Create

List of utility methods to do Buffer Create

Description

The list of methods to do Buffer Create are organized into topic(s).

Method

voidcopy(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));
voidcopy(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));
voidcopy(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));
voidcopy(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));
voidcopy(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);
voidcopy(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));
voidcopy(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));
voidcopy(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));
voidcopy(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));