public class ByteArrayIndexer extends ByteIndexer
byte[] array.| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
array
The backing array.
|
protected ByteBuffer |
buffer
The wrapping buffer.
|
protected static Raw |
RAW
The instance for the raw memory interface.
|
VALUE_BYTES| Constructor and Description |
|---|
ByteArrayIndexer(byte[] array)
Calls
ByteArrayIndexer(array, Index.create(array.length)). |
ByteArrayIndexer(byte[] array,
Index index)
Constructor to set the
array and Indexer.index. |
ByteArrayIndexer(byte[] array,
long... sizes)
Calls
ByteArrayIndexer(array, Index.create(sizes)). |
ByteArrayIndexer(byte[] array,
long[] sizes,
long[] strides)
Calls
ByteArrayIndexer(array, Index.create(sizes, strides)). |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
array()
Returns the backing array, or
null if none |
byte |
get(long... indices)
Returns
array/buffer[index(indices)] |
byte |
get(long i)
Returns
array/buffer[index(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[index(i)] |
byte |
get(long i,
long j)
Returns
array/buffer[index(i, j)] |
ByteIndexer |
get(long i,
long j,
byte[] b,
int offset,
int length)
Returns
this where b[offset:offset + length] = array/buffer[index(i, j)] |
byte |
get(long i,
long j,
long k)
Returns
array/buffer[index(i, j, k)] |
(package private) ByteBuffer |
getBuffer() |
byte |
getByte(long i)
Returns the
byte value at array/buffer[i] |
char |
getChar(long i)
Returns the
char value at array/buffer[i] |
double |
getDouble(long i)
Returns the
double value at array/buffer[i] |
float |
getFloat(long i)
Returns the
float value at array/buffer[i] |
int |
getInt(long i)
Returns the
int value at array/buffer[i] |
long |
getLong(long i)
Returns the
long value at array/buffer[i] |
short |
getShort(long i)
Returns the
short value at array/buffer[i] |
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[index(i)] = b |
ByteIndexer |
put(long i,
byte[] b,
int offset,
int length)
Returns
this where array/buffer[index(i)] = b[offset:offset + length] |
ByteIndexer |
put(long i,
long j,
byte b)
Returns
this where array/buffer[index(i, j)] = b |
ByteIndexer |
put(long i,
long j,
byte[] b,
int offset,
int length)
Returns
this where array/buffer[index(i, j)] = b[offset:offset + length] |
ByteIndexer |
put(long i,
long j,
long k,
byte b)
Returns
this where array/buffer[index(i, j, k)] = b |
ByteIndexer |
putByte(long i,
byte b)
Sets the
byte value at array/buffer[i] |
ByteIndexer |
putChar(long i,
char c)
Sets the
char value at array/buffer[i] |
ByteIndexer |
putDouble(long i,
double d)
Sets the
double value at array/buffer[i] |
ByteIndexer |
putFloat(long i,
float f)
Sets the
float value at array/buffer[i] |
ByteIndexer |
putInt(long i,
int j)
Sets the
int value at array/buffer[i] |
ByteIndexer |
putLong(long i,
long j)
Sets the
long value at array/buffer[i] |
ByteIndexer |
putShort(long i,
short s)
Sets the
short value at array/buffer[i] |
ByteIndexer |
reindex(Index index)
Returns a new Indexer using the same data, but with a different Index.
|
void |
release()
Makes sure changes are reflected onto the backing memory and clears any references.
|
create, create, create, create, create, create, create, create, create, create, create, create, create, create, get, get, get, getBfloat16, getBoolean, getDouble, getHalf, getUByte, getUInt, getULong, getUShort, put, put, put, putBfloat16, putBoolean, putDouble, putHalf, putUByte, putUInt, putULong, putUShortprotected static final Raw RAW
protected ByteBuffer buffer
protected byte[] array
public ByteArrayIndexer(byte[] array)
ByteArrayIndexer(array, Index.create(array.length)).public ByteArrayIndexer(byte[] array,
long... sizes)
ByteArrayIndexer(array, Index.create(sizes)).public ByteArrayIndexer(byte[] array,
long[] sizes,
long[] strides)
ByteArrayIndexer(array, Index.create(sizes, strides)).public ByteArrayIndexer(byte[] array,
Index index)
array and Indexer.index.public byte[] array()
Indexernull if nonepublic ByteIndexer reindex(Index index)
Indexerpublic byte get(long i)
ByteIndexerarray/buffer[index(i)]get in class ByteIndexerpublic ByteIndexer get(long i, byte[] b, int offset, int length)
ByteIndexerthis where b[offset:offset + length] = array/buffer[index(i)]get in class ByteIndexerpublic byte get(long i,
long j)
ByteIndexerarray/buffer[index(i, 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[index(i, j)]get in class ByteIndexerpublic byte get(long i,
long j,
long k)
ByteIndexerarray/buffer[index(i, j, 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[index(i)] = bput in class ByteIndexerpublic ByteIndexer put(long i, byte[] b, int offset, int length)
ByteIndexerthis where array/buffer[index(i)] = b[offset:offset + length]put in class ByteIndexerpublic ByteIndexer put(long i, long j, byte b)
ByteIndexerthis where array/buffer[index(i, j)] = bput in class ByteIndexerpublic ByteIndexer put(long i, long j, byte[] b, int offset, int length)
ByteIndexerthis where array/buffer[index(i, j)] = b[offset:offset + length]put in class ByteIndexerpublic ByteIndexer put(long i, long j, long k, byte b)
ByteIndexerthis where array/buffer[index(i, j, 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 ByteIndexerByteBuffer getBuffer()
public byte getByte(long i)
ByteIndexerbyte value at array/buffer[i]getByte in class ByteIndexerpublic ByteIndexer putByte(long i, byte b)
ByteIndexerbyte value at array/buffer[i]putByte in class ByteIndexerpublic short getShort(long i)
ByteIndexershort value at array/buffer[i]getShort in class ByteIndexerpublic ByteIndexer putShort(long i, short s)
ByteIndexershort value at array/buffer[i]putShort in class ByteIndexerpublic int getInt(long i)
ByteIndexerint value at array/buffer[i]getInt in class ByteIndexerpublic ByteIndexer putInt(long i, int j)
ByteIndexerint value at array/buffer[i]putInt in class ByteIndexerpublic long getLong(long i)
ByteIndexerlong value at array/buffer[i]getLong in class ByteIndexerpublic ByteIndexer putLong(long i, long j)
ByteIndexerlong value at array/buffer[i]putLong in class ByteIndexerpublic float getFloat(long i)
ByteIndexerfloat value at array/buffer[i]getFloat in class ByteIndexerpublic ByteIndexer putFloat(long i, float f)
ByteIndexerfloat value at array/buffer[i]putFloat in class ByteIndexerpublic double getDouble(long i)
ByteIndexerdouble value at array/buffer[i]getDouble in class ByteIndexerpublic ByteIndexer putDouble(long i, double d)
ByteIndexerdouble value at array/buffer[i]putDouble in class ByteIndexerpublic char getChar(long i)
ByteIndexerchar value at array/buffer[i]getChar in class ByteIndexerpublic ByteIndexer putChar(long i, char c)
ByteIndexerchar value at array/buffer[i]putChar in class ByteIndexerCopyright © 2024. All rights reserved.