public class ByteBufferIndexer extends ByteIndexer
ByteBuffer.| Modifier and Type | Field and Description |
|---|---|
protected ByteBuffer |
buffer
The backing buffer.
|
VALUE_BYTESindexable, ONE_STRIDE, sizes, strides| Constructor and Description |
|---|
ByteBufferIndexer(ByteBuffer buffer)
Calls
ByteBufferIndexer(buffer, { buffer.limit() }, { 1 }). |
ByteBufferIndexer(ByteBuffer buffer,
long[] sizes,
long[] strides)
|
| Modifier and Type | Method and Description |
|---|---|
Buffer |
buffer()
Returns the backing buffer, or
null if none |
byte |
get(long... indices)
Returns
array/buffer[index(indices)] |
byte |
get(long i)
Returns
array/buffer[i] |
ByteIndexer |
get(long[] indices,
byte[] b,
int offset,
int length)
Returns
this where b[offset:offset + length] = array/buffer[index(indices)] |
ByteIndexer |
get(long i,
byte[] b,
int offset,
int length)
Returns
this where b[offset:offset + length] = array/buffer[i] |
byte |
get(long i,
long j)
Returns
array/buffer[i * strides[0] + j] |
ByteIndexer |
get(long i,
long j,
byte[] b,
int offset,
int length)
Returns
this where b[offset:offset + length] = array/buffer[i * strides[0] + j] |
byte |
get(long i,
long j,
long k)
Returns
array/buffer[i * strides[0] + j * strides[1] + k] |
ByteIndexer |
put(long[] indices,
byte b)
Returns
this where array/buffer[index(indices)] = b |
ByteIndexer |
put(long[] indices,
byte[] b,
int offset,
int length)
Returns
this where array/buffer[index(indices)] = b[offset:offset + length] |
ByteIndexer |
put(long i,
byte b)
Returns
this where array/buffer[i] = b |
ByteIndexer |
put(long i,
byte[] b,
int offset,
int length)
Returns
this where array/buffer[i] = b[offset:offset + length] |
ByteIndexer |
put(long i,
long j,
byte b)
Returns
this where array/buffer[i * strides[0] + j] = b |
ByteIndexer |
put(long i,
long j,
byte[] b,
int offset,
int length)
Returns
this where array/buffer[i * strides[0] + j] = b[offset:offset + length] |
ByteIndexer |
put(long i,
long j,
long k,
byte b)
Returns
this where array/buffer[i * strides[0] + j * strides[1] + k] = b |
void |
release()
Makes sure changes are reflected onto the backing memory and clears any references.
|
create, create, create, create, create, create, create, get, get, get, getDouble, put, put, put, putDoubleprotected ByteBuffer buffer
public ByteBufferIndexer(ByteBuffer buffer)
ByteBufferIndexer(buffer, { buffer.limit() }, { 1 }).public ByteBufferIndexer(ByteBuffer buffer, long[] sizes, long[] strides)
public Buffer buffer()
Indexernull if nonepublic byte get(long i)
ByteIndexerarray/buffer[i]get in class ByteIndexerpublic ByteIndexer get(long i, byte[] b, int offset, int length)
ByteIndexerthis where b[offset:offset + length] = array/buffer[i]get in class ByteIndexerpublic byte get(long i,
long j)
ByteIndexerarray/buffer[i * strides[0] + j]get in class ByteIndexerpublic ByteIndexer get(long i, long j, byte[] b, int offset, int length)
ByteIndexerthis where b[offset:offset + length] = array/buffer[i * strides[0] + j]get in class ByteIndexerpublic byte get(long i,
long j,
long k)
ByteIndexerarray/buffer[i * strides[0] + j * strides[1] + k]get in class ByteIndexerpublic byte get(long... indices)
ByteIndexerarray/buffer[index(indices)]get in class ByteIndexerpublic ByteIndexer get(long[] indices, byte[] b, int offset, int length)
ByteIndexerthis where b[offset:offset + length] = array/buffer[index(indices)]get in class ByteIndexerpublic ByteIndexer put(long i, byte b)
ByteIndexerthis where array/buffer[i] = bput in class ByteIndexerpublic ByteIndexer put(long i, byte[] b, int offset, int length)
ByteIndexerthis where array/buffer[i] = b[offset:offset + length]put in class ByteIndexerpublic ByteIndexer put(long i, long j, byte b)
ByteIndexerthis where array/buffer[i * strides[0] + j] = bput in class ByteIndexerpublic ByteIndexer put(long i, long j, byte[] b, int offset, int length)
ByteIndexerthis where array/buffer[i * strides[0] + j] = b[offset:offset + length]put in class ByteIndexerpublic ByteIndexer put(long i, long j, long k, byte b)
ByteIndexerthis where array/buffer[i * strides[0] + j * strides[1] + k] = bput in class ByteIndexerpublic ByteIndexer put(long[] indices, byte b)
ByteIndexerthis where array/buffer[index(indices)] = bput in class ByteIndexerpublic ByteIndexer put(long[] indices, byte[] b, int offset, int length)
ByteIndexerthis where array/buffer[index(indices)] = b[offset:offset + length]put in class ByteIndexerCopyright © 2017. All rights reserved.