Class ByteArrayIndexer
java.lang.Object
org.bytedeco.javacpp.indexer.Indexer
org.bytedeco.javacpp.indexer.ByteIndexer
org.bytedeco.javacpp.indexer.ByteArrayIndexer
- All Implemented Interfaces:
AutoCloseable
An indexer for a
byte[] array.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]The backing array.protected ByteBufferThe wrapping buffer.protected static final RawThe instance for the raw memory interface.Fields inherited from class ByteIndexer
VALUE_BYTES -
Constructor Summary
ConstructorsConstructorDescriptionByteArrayIndexer(byte[] array) CallsByteArrayIndexer(array, Index.create(array.length)).ByteArrayIndexer(byte[] array, long... sizes) CallsByteArrayIndexer(array, Index.create(sizes)).ByteArrayIndexer(byte[] array, long[] sizes, long[] strides) CallsByteArrayIndexer(array, Index.create(sizes, strides)).ByteArrayIndexer(byte[] array, Index index) Constructor to set thearrayandIndexer.index. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]array()Returns the backing array, ornullif nonebyteget(long i) Returnsarray/buffer[index(i)]byteget(long... indices) Returnsarray/buffer[index(indices)]get(long[] indices, byte[] b, int offset, int length) Returnsthiswhereb[offset:offset + length] = array/buffer[index(indices)]get(long i, byte[] b, int offset, int length) Returnsthiswhereb[offset:offset + length] = array/buffer[index(i)]byteget(long i, long j) Returnsarray/buffer[index(i, j)]get(long i, long j, byte[] b, int offset, int length) Returnsthiswhereb[offset:offset + length] = array/buffer[index(i, j)]byteget(long i, long j, long k) Returnsarray/buffer[index(i, j, k)](package private) ByteBufferbytegetByte(long i) Returns thebytevalue atarray/buffer[i]chargetChar(long i) Returns thecharvalue atarray/buffer[i]doublegetDouble(long i) Returns thedoublevalue atarray/buffer[i]floatgetFloat(long i) Returns thefloatvalue atarray/buffer[i]intgetInt(long i) Returns theintvalue atarray/buffer[i]longgetLong(long i) Returns thelongvalue atarray/buffer[i]shortgetShort(long i) Returns theshortvalue atarray/buffer[i]put(long[] indices, byte b) Returnsthiswherearray/buffer[index(indices)] = bput(long[] indices, byte[] b, int offset, int length) Returnsthiswherearray/buffer[index(indices)] = b[offset:offset + length]put(long i, byte b) Returnsthiswherearray/buffer[index(i)] = bput(long i, byte[] b, int offset, int length) Returnsthiswherearray/buffer[index(i)] = b[offset:offset + length]put(long i, long j, byte b) Returnsthiswherearray/buffer[index(i, j)] = bput(long i, long j, byte[] b, int offset, int length) Returnsthiswherearray/buffer[index(i, j)] = b[offset:offset + length]put(long i, long j, long k, byte b) Returnsthiswherearray/buffer[index(i, j, k)] = bputByte(long i, byte b) Sets thebytevalue atarray/buffer[i]putChar(long i, char c) Sets thecharvalue atarray/buffer[i]putDouble(long i, double d) Sets thedoublevalue atarray/buffer[i]putFloat(long i, float f) Sets thefloatvalue atarray/buffer[i]putInt(long i, int j) Sets theintvalue atarray/buffer[i]putLong(long i, long j) Sets thelongvalue atarray/buffer[i]putShort(long i, short s) Sets theshortvalue atarray/buffer[i]Returns a new Indexer using the same data, but with a different Index.voidrelease()Makes sure changes are reflected onto the backing memory and clears any references.Methods inherited from class ByteIndexer
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, putUShort
-
Field Details
-
RAW
The instance for the raw memory interface. -
buffer
The wrapping buffer. -
array
protected byte[] arrayThe backing array.
-
-
Constructor Details
-
ByteArrayIndexer
public ByteArrayIndexer(byte[] array) CallsByteArrayIndexer(array, Index.create(array.length)). -
ByteArrayIndexer
public ByteArrayIndexer(byte[] array, long... sizes) CallsByteArrayIndexer(array, Index.create(sizes)). -
ByteArrayIndexer
public ByteArrayIndexer(byte[] array, long[] sizes, long[] strides) CallsByteArrayIndexer(array, Index.create(sizes, strides)). -
ByteArrayIndexer
Constructor to set thearrayandIndexer.index.
-
-
Method Details
-
array
-
reindex
Description copied from class:IndexerReturns a new Indexer using the same data, but with a different Index. -
get
public byte get(long i) Description copied from class:ByteIndexerReturnsarray/buffer[index(i)]- Specified by:
getin classByteIndexer
-
get
Description copied from class:ByteIndexerReturnsthiswhereb[offset:offset + length] = array/buffer[index(i)]- Specified by:
getin classByteIndexer
-
get
public byte get(long i, long j) Description copied from class:ByteIndexerReturnsarray/buffer[index(i, j)]- Specified by:
getin classByteIndexer
-
get
Description copied from class:ByteIndexerReturnsthiswhereb[offset:offset + length] = array/buffer[index(i, j)]- Specified by:
getin classByteIndexer
-
get
public byte get(long i, long j, long k) Description copied from class:ByteIndexerReturnsarray/buffer[index(i, j, k)]- Specified by:
getin classByteIndexer
-
get
public byte get(long... indices) Description copied from class:ByteIndexerReturnsarray/buffer[index(indices)]- Specified by:
getin classByteIndexer
-
get
Description copied from class:ByteIndexerReturnsthiswhereb[offset:offset + length] = array/buffer[index(indices)]- Specified by:
getin classByteIndexer
-
put
Description copied from class:ByteIndexerReturnsthiswherearray/buffer[index(i)] = b- Specified by:
putin classByteIndexer
-
put
Description copied from class:ByteIndexerReturnsthiswherearray/buffer[index(i)] = b[offset:offset + length]- Specified by:
putin classByteIndexer
-
put
Description copied from class:ByteIndexerReturnsthiswherearray/buffer[index(i, j)] = b- Specified by:
putin classByteIndexer
-
put
Description copied from class:ByteIndexerReturnsthiswherearray/buffer[index(i, j)] = b[offset:offset + length]- Specified by:
putin classByteIndexer
-
put
Description copied from class:ByteIndexerReturnsthiswherearray/buffer[index(i, j, k)] = b- Specified by:
putin classByteIndexer
-
put
Description copied from class:ByteIndexerReturnsthiswherearray/buffer[index(indices)] = b- Specified by:
putin classByteIndexer
-
put
Description copied from class:ByteIndexerReturnsthiswherearray/buffer[index(indices)] = b[offset:offset + length]- Specified by:
putin classByteIndexer
-
getBuffer
ByteBuffer getBuffer() -
getByte
public byte getByte(long i) Description copied from class:ByteIndexerReturns thebytevalue atarray/buffer[i]- Specified by:
getBytein classByteIndexer
-
putByte
Description copied from class:ByteIndexerSets thebytevalue atarray/buffer[i]- Specified by:
putBytein classByteIndexer
-
getShort
public short getShort(long i) Description copied from class:ByteIndexerReturns theshortvalue atarray/buffer[i]- Specified by:
getShortin classByteIndexer
-
putShort
Description copied from class:ByteIndexerSets theshortvalue atarray/buffer[i]- Specified by:
putShortin classByteIndexer
-
getInt
public int getInt(long i) Description copied from class:ByteIndexerReturns theintvalue atarray/buffer[i]- Specified by:
getIntin classByteIndexer
-
putInt
Description copied from class:ByteIndexerSets theintvalue atarray/buffer[i]- Specified by:
putIntin classByteIndexer
-
getLong
public long getLong(long i) Description copied from class:ByteIndexerReturns thelongvalue atarray/buffer[i]- Specified by:
getLongin classByteIndexer
-
putLong
Description copied from class:ByteIndexerSets thelongvalue atarray/buffer[i]- Specified by:
putLongin classByteIndexer
-
getFloat
public float getFloat(long i) Description copied from class:ByteIndexerReturns thefloatvalue atarray/buffer[i]- Specified by:
getFloatin classByteIndexer
-
putFloat
Description copied from class:ByteIndexerSets thefloatvalue atarray/buffer[i]- Specified by:
putFloatin classByteIndexer
-
getDouble
public double getDouble(long i) Description copied from class:ByteIndexerReturns thedoublevalue atarray/buffer[i]- Specified by:
getDoublein classByteIndexer
-
putDouble
Description copied from class:ByteIndexerSets thedoublevalue atarray/buffer[i]- Specified by:
putDoublein classByteIndexer
-
getChar
public char getChar(long i) Description copied from class:ByteIndexerReturns thecharvalue atarray/buffer[i]- Specified by:
getCharin classByteIndexer
-
putChar
Description copied from class:ByteIndexerSets thecharvalue atarray/buffer[i]- Specified by:
putCharin classByteIndexer
-
release
-