List of utility methods to do ShortBuffer Create
ShortBuffer | createShortIndicesBuffer( 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); ... |
ShortBuffer | newShortBuffer(int numShorts) new Short Buffer ByteBuffer buffer = ByteBuffer.allocateDirect(numShorts * 2);
buffer.order(ByteOrder.nativeOrder());
return buffer.asShortBuffer();
|
ShortBuffer | newShortBuffer(int numShorts) new Short Buffer ByteBuffer buffer = ByteBuffer.allocateDirect(numShorts * 2);
buffer.order(ByteOrder.nativeOrder());
return buffer.asShortBuffer();
|
ShortBuffer | newShortBuffer(int paramInt) new Short Buffer ByteBuffer localByteBuffer = newByteBuffer(paramInt * 2);
return localByteBuffer.asShortBuffer();
|
ShortBuffer | makeShortBuffer(int size) make Short Buffer ByteBuffer bb = ByteBuffer.allocateDirect(size * 2);
bb.order(ByteOrder.nativeOrder());
ShortBuffer Ib = bb.asShortBuffer();
Ib.position(0);
return Ib;
|
ShortBuffer | makeShortBuffer(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;
|
ShortBuffer | createDirectShortBuffer( final int capacity) create Direct Short Buffer return createDirectByteBuffer(capacity * BYTES_PER_SHORT)
.asShortBuffer();
|
ShortBuffer | createDirectShortBuffer( 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; |
ShortBuffer | buildShortBuffer(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);
...
|
ShortBuffer | asShortBuffer(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;
|