Android Utililty Methods ShortBuffer Create

List of utility methods to do ShortBuffer Create

Description

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

Method

voidcopy(short[] src, ShortBuffer dst, int numShorts, int offset)
copy
dst.clear();
dst.limit(numShorts);
dst.put(src, offset, numShorts);
dst.flip();
ShortBuffernewShortBuffer(int numShorts)
new Short Buffer
ByteBuffer buffer = ByteBuffer.allocateDirect(numShorts * 2);
buffer.order(ByteOrder.nativeOrder());
return buffer.asShortBuffer();
ShortBuffernewShortBuffer(int numShorts)
new Short Buffer
ByteBuffer buffer = ByteBuffer.allocateDirect(numShorts * 2);
buffer.order(ByteOrder.nativeOrder());
return buffer.asShortBuffer();
ShortBuffercreateShortBuffer(int capacity)
Creates a ShortBuffer with the specified capacity.
return createByteBuffer(capacity * 2).asShortBuffer();
ShortBuffercreateShortBuffer(int shortCount)
create Short Buffer
ByteBuffer data = ByteBuffer.allocateDirect(shortCount * 4);
data.order(ByteOrder.nativeOrder());
ShortBuffer p1 = data.asShortBuffer();
return p1;
ShortBuffercreateShortBuffer(int size)
create Short Buffer
ByteBuffer bf = ByteBuffer.allocateDirect(size * 2);
return bf.order(ByteOrder.nativeOrder()).asShortBuffer();
ShortBuffercreateShortBuffer(int size)
create Short Buffer
ByteBuffer bb = ByteBuffer.allocateDirect(size * 2);
bb.order(ByteOrder.nativeOrder());
return bb.asShortBuffer();
ShortBuffercreateShortBuffer(short[] data)
Creates a ShortBuffer from the specified short array.
ShortBuffer b = createShortBuffer(data.length);
b.put(data);
b.rewind();
return b;
ShortBuffercreateShortBuffer(short[] shortData)
create Short Buffer
ShortBuffer buffer = ByteBuffer
        .allocateDirect(shortData.length * BYTES_PER_SHORT)
        .order(ByteOrder.nativeOrder()).asShortBuffer()
        .put(shortData);
buffer.position(0);
return buffer;
ShortBuffercreateShortIndicesBuffer( final int capacity)
create Short Indices Buffer
final ShortBuffer indices = createDirectShortBuffer(capacity);
fillIndices(indices, 0, capacity);
return indices;