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

ShortBuffergetShortBuffer(short[] list)
Produce un ShortBuffer a partir de una lista de shorts
ByteBuffer bb = ByteBuffer.allocateDirect(list.length * Short.SIZE
        / 8);
bb.order(ByteOrder.nativeOrder());
ShortBuffer sb = bb.asShortBuffer();
sb.put(list);
sb.position(0);
return sb;
ShortBuffertoShortBuffer(short[] array)
to Short Buffer
ByteBuffer bb = ByteBuffer.allocateDirect(array.length << 1);
bb.order(ByteOrder.nativeOrder());
bb.position(0);
ShortBuffer sbb = bb.asShortBuffer();
sbb.put(array);
return sbb;
ShortBuffershotToBuffer(short[] a)
shot To Buffer
ByteBuffer mbb = ByteBuffer.allocateDirect(a.length * 2);
mbb.order(ByteOrder.nativeOrder());
ShortBuffer sBuffer = mbb.asShortBuffer();
sBuffer.put(a);
sBuffer.position(0);
return sBuffer;
ShortBuffersetupShortBuffer(ShortBuffer preBuffer, short[] array)
setup Short Buffer
if (preBuffer == null || preBuffer.capacity() < array.length) {
    preBuffer = createShortBuffer(array.length * 2);
} else {
    preBuffer.clear();
preBuffer.clear();
preBuffer.put(array);
preBuffer.position(0);
...
ShortBufferwrap(short[] buffer)
wrap
return (ShortBuffer) ByteBuffer.allocateDirect(buffer.length * 2)
        .order(ByteOrder.nativeOrder()).asShortBuffer().put(buffer)
        .position(0);
ShortBufferConvToShortBuffer(short buf[])
Conv To Short Buffer
ShortBuffer ReturnBuffer = ShortBuffer.allocate(buf.length);
ReturnBuffer.put(buf);
ReturnBuffer.position(0);
return ReturnBuffer;
ShortBufferConvToShortBuffer(short buf[])
Conv To Short Buffer
ShortBuffer ReturnBuffer = ShortBuffer.allocate(buf.length);
ReturnBuffer.put(buf);
ReturnBuffer.position(0);
return ReturnBuffer;