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

ShortBuffercreateShortIndicesBuffer( final int capacity, final ShortBuffer previous)
create Short Indices Buffer
if (null == previous) {
    return createShortIndicesBuffer(capacity);
final int oldPosition = previous.position();
previous.position(previous.capacity());
final ShortBuffer created = createDirectShortBuffer(capacity,
        previous);
fillIndices(created, previous.capacity(), capacity);
...
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();
ShortBuffernewShortBuffer(int paramInt)
new Short Buffer
ByteBuffer localByteBuffer = newByteBuffer(paramInt * 2);
return localByteBuffer.asShortBuffer();
ShortBuffermakeShortBuffer(int size)
make Short Buffer
ByteBuffer bb = ByteBuffer.allocateDirect(size * 2);
bb.order(ByteOrder.nativeOrder());
ShortBuffer Ib = bb.asShortBuffer();
Ib.position(0);
return Ib;
ShortBuffermakeShortBuffer(short[] arr)
make Short Buffer
ByteBuffer bb = ByteBuffer.allocateDirect(arr.length * 2);
bb.order(ByteOrder.nativeOrder());
ShortBuffer Ib = bb.asShortBuffer();
Ib.put(arr);
Ib.position(0);
return Ib;
ShortBuffercreateDirectShortBuffer( final int capacity)
create Direct Short Buffer
return createDirectByteBuffer(capacity * BYTES_PER_SHORT)
        .asShortBuffer();
ShortBuffercreateDirectShortBuffer( final int capacity, final ShortBuffer previous)
create Direct Short Buffer
final ShortBuffer created = createDirectShortBuffer(capacity);
if (null != previous) {
    previous.flip();
    created.put(previous);
return created;
ShortBufferbuildShortBuffer(short[] buffer)
build ShortBuffer: short[] -> ShortBuffer
ShortBuffer ret = null;
if (buffer != null) {
    ByteBuffer byteBuffer = ByteBuffer
            .allocateDirect(buffer.length * 2);
    byteBuffer.order(ByteOrder.nativeOrder());
    ret = byteBuffer.asShortBuffer();
    ret.put(buffer);
    ret.position(0);
...
ShortBufferasShortBuffer(short[] array)
as Short Buffer
ByteBuffer bbuf = ByteBuffer.allocateDirect(array.length
        * BYTES_PER_SHORT);
bbuf.order(ByteOrder.nativeOrder());
ShortBuffer sbuf = bbuf.asShortBuffer();
sbuf.put(array);
sbuf.position(0);
return sbuf;