List of utility methods to do ShortBuffer Create
ShortBuffer | getShortBuffer(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;
|
ShortBuffer | toShortBuffer(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;
|
ShortBuffer | shotToBuffer(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;
|
ShortBuffer | setupShortBuffer(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); ... |
ShortBuffer | wrap(short[] buffer) wrap return (ShortBuffer) ByteBuffer.allocateDirect(buffer.length * 2)
.order(ByteOrder.nativeOrder()).asShortBuffer().put(buffer)
.position(0);
|
ShortBuffer | ConvToShortBuffer(short buf[]) Conv To Short Buffer ShortBuffer ReturnBuffer = ShortBuffer.allocate(buf.length);
ReturnBuffer.put(buf);
ReturnBuffer.position(0);
return ReturnBuffer;
|
ShortBuffer | ConvToShortBuffer(short buf[]) Conv To Short Buffer ShortBuffer ReturnBuffer = ShortBuffer.allocate(buf.length);
ReturnBuffer.put(buf);
ReturnBuffer.position(0);
return ReturnBuffer;
|