Package org.bytedeco.javacpp.indexer
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 ByteBuffer
The wrapping buffer.protected static final Raw
The instance for the raw memory interface.Fields inherited from class org.bytedeco.javacpp.indexer.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 thearray
andIndexer.index
. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
array()
Returns the backing array, ornull
if nonebyte
get
(long i) Returnsarray/buffer[index(i)]
byte
get
(long... indices) Returnsarray/buffer[index(indices)]
get
(long[] indices, byte[] b, int offset, int length) Returnsthis
whereb[offset:offset + length] = array/buffer[index(indices)]
get
(long i, byte[] b, int offset, int length) Returnsthis
whereb[offset:offset + length] = array/buffer[index(i)]
byte
get
(long i, long j) Returnsarray/buffer[index(i, j)]
get
(long i, long j, byte[] b, int offset, int length) Returnsthis
whereb[offset:offset + length] = array/buffer[index(i, j)]
byte
get
(long i, long j, long k) Returnsarray/buffer[index(i, j, k)]
(package private) ByteBuffer
byte
getByte
(long i) Returns thebyte
value atarray/buffer[i]
char
getChar
(long i) Returns thechar
value atarray/buffer[i]
double
getDouble
(long i) Returns thedouble
value atarray/buffer[i]
float
getFloat
(long i) Returns thefloat
value atarray/buffer[i]
int
getInt
(long i) Returns theint
value atarray/buffer[i]
long
getLong
(long i) Returns thelong
value atarray/buffer[i]
short
getShort
(long i) Returns theshort
value atarray/buffer[i]
put
(long[] indices, byte b) Returnsthis
wherearray/buffer[index(indices)] = b
put
(long[] indices, byte[] b, int offset, int length) Returnsthis
wherearray/buffer[index(indices)] = b[offset:offset + length]
put
(long i, byte b) Returnsthis
wherearray/buffer[index(i)] = b
put
(long i, byte[] b, int offset, int length) Returnsthis
wherearray/buffer[index(i)] = b[offset:offset + length]
put
(long i, long j, byte b) Returnsthis
wherearray/buffer[index(i, j)] = b
put
(long i, long j, byte[] b, int offset, int length) Returnsthis
wherearray/buffer[index(i, j)] = b[offset:offset + length]
put
(long i, long j, long k, byte b) Returnsthis
wherearray/buffer[index(i, j, k)] = b
putByte
(long i, byte b) Sets thebyte
value atarray/buffer[i]
putChar
(long i, char c) Sets thechar
value atarray/buffer[i]
putDouble
(long i, double d) Sets thedouble
value atarray/buffer[i]
putFloat
(long i, float f) Sets thefloat
value atarray/buffer[i]
putInt
(long i, int j) Sets theint
value atarray/buffer[i]
putLong
(long i, long j) Sets thelong
value atarray/buffer[i]
putShort
(long i, short s) Sets theshort
value atarray/buffer[i]
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.Methods inherited from class org.bytedeco.javacpp.indexer.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 thearray
andIndexer.index
.
-
-
Method Details
-
array
public byte[] array()Description copied from class:Indexer
Returns the backing array, ornull
if none -
reindex
Description copied from class:Indexer
Returns a new Indexer using the same data, but with a different Index. -
get
public byte get(long i) Description copied from class:ByteIndexer
Returnsarray/buffer[index(i)]
- Specified by:
get
in classByteIndexer
-
get
Description copied from class:ByteIndexer
Returnsthis
whereb[offset:offset + length] = array/buffer[index(i)]
- Specified by:
get
in classByteIndexer
-
get
public byte get(long i, long j) Description copied from class:ByteIndexer
Returnsarray/buffer[index(i, j)]
- Specified by:
get
in classByteIndexer
-
get
Description copied from class:ByteIndexer
Returnsthis
whereb[offset:offset + length] = array/buffer[index(i, j)]
- Specified by:
get
in classByteIndexer
-
get
public byte get(long i, long j, long k) Description copied from class:ByteIndexer
Returnsarray/buffer[index(i, j, k)]
- Specified by:
get
in classByteIndexer
-
get
public byte get(long... indices) Description copied from class:ByteIndexer
Returnsarray/buffer[index(indices)]
- Specified by:
get
in classByteIndexer
-
get
Description copied from class:ByteIndexer
Returnsthis
whereb[offset:offset + length] = array/buffer[index(indices)]
- Specified by:
get
in classByteIndexer
-
put
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(i)] = b
- Specified by:
put
in classByteIndexer
-
put
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(i)] = b[offset:offset + length]
- Specified by:
put
in classByteIndexer
-
put
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(i, j)] = b
- Specified by:
put
in classByteIndexer
-
put
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(i, j)] = b[offset:offset + length]
- Specified by:
put
in classByteIndexer
-
put
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(i, j, k)] = b
- Specified by:
put
in classByteIndexer
-
put
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(indices)] = b
- Specified by:
put
in classByteIndexer
-
put
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(indices)] = b[offset:offset + length]
- Specified by:
put
in classByteIndexer
-
getBuffer
ByteBuffer getBuffer() -
getByte
public byte getByte(long i) Description copied from class:ByteIndexer
Returns thebyte
value atarray/buffer[i]
- Specified by:
getByte
in classByteIndexer
-
putByte
Description copied from class:ByteIndexer
Sets thebyte
value atarray/buffer[i]
- Specified by:
putByte
in classByteIndexer
-
getShort
public short getShort(long i) Description copied from class:ByteIndexer
Returns theshort
value atarray/buffer[i]
- Specified by:
getShort
in classByteIndexer
-
putShort
Description copied from class:ByteIndexer
Sets theshort
value atarray/buffer[i]
- Specified by:
putShort
in classByteIndexer
-
getInt
public int getInt(long i) Description copied from class:ByteIndexer
Returns theint
value atarray/buffer[i]
- Specified by:
getInt
in classByteIndexer
-
putInt
Description copied from class:ByteIndexer
Sets theint
value atarray/buffer[i]
- Specified by:
putInt
in classByteIndexer
-
getLong
public long getLong(long i) Description copied from class:ByteIndexer
Returns thelong
value atarray/buffer[i]
- Specified by:
getLong
in classByteIndexer
-
putLong
Description copied from class:ByteIndexer
Sets thelong
value atarray/buffer[i]
- Specified by:
putLong
in classByteIndexer
-
getFloat
public float getFloat(long i) Description copied from class:ByteIndexer
Returns thefloat
value atarray/buffer[i]
- Specified by:
getFloat
in classByteIndexer
-
putFloat
Description copied from class:ByteIndexer
Sets thefloat
value atarray/buffer[i]
- Specified by:
putFloat
in classByteIndexer
-
getDouble
public double getDouble(long i) Description copied from class:ByteIndexer
Returns thedouble
value atarray/buffer[i]
- Specified by:
getDouble
in classByteIndexer
-
putDouble
Description copied from class:ByteIndexer
Sets thedouble
value atarray/buffer[i]
- Specified by:
putDouble
in classByteIndexer
-
getChar
public char getChar(long i) Description copied from class:ByteIndexer
Returns thechar
value atarray/buffer[i]
- Specified by:
getChar
in classByteIndexer
-
putChar
Description copied from class:ByteIndexer
Sets thechar
value atarray/buffer[i]
- Specified by:
putChar
in classByteIndexer
-
release
public void release()Description copied from class:Indexer
Makes sure changes are reflected onto the backing memory and clears any references.
-