java.lang.Object | |
↳ | com.pnfsoftware.jeb.util.io.ByteArray |
Primitive reader for little-endian byte arrays. Support for fixed-length primitive and variable-length LEB128-encoded primitives.
A max bound (see maxPosition()
) can be set on the array. It can be be adjusted at any
time after object creation. When a max bound is set, reading past that bound will generate a
runtime exception. The bound is always relative to the full array length.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ByteArray(byte[] bytes)
Create a little-endian
byte[] reader with an initial index of 0. | |||||||||||
ByteArray(byte[] bytes, int pos)
Create a little-endian
byte[] reader with the provided initial index. | |||||||||||
ByteArray(byte[] bytes, int pos, int maxpos)
Create a little-endian
byte[] reader with the provided initial and maximum positions. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | available() | ||||||||||
byte[] | bytes() | ||||||||||
ByteArray | copy(int index, int maxindex) | ||||||||||
ByteArray | copy(int index) | ||||||||||
ByteArray | copy() | ||||||||||
byte | get() | ||||||||||
byte[] | get(int cnt) | ||||||||||
int | i16() | ||||||||||
int | i32() | ||||||||||
long | i64() | ||||||||||
int | i8() | ||||||||||
int | maxPosition() | ||||||||||
int | maxPosition(int pos) | ||||||||||
int | position(int pos) | ||||||||||
int | position() | ||||||||||
void | skip(int cnt) | ||||||||||
String | toString() | ||||||||||
int | u16() | ||||||||||
int | u31() | ||||||||||
long | u32() | ||||||||||
long | u63() | ||||||||||
int | u8() | ||||||||||
int | vari32() | ||||||||||
long | vari64() | ||||||||||
int | varu16() | ||||||||||
long | varu32() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a little-endian byte[]
reader with an initial index of 0.
Create a little-endian byte[]
reader with the provided initial index.
Create a little-endian byte[]
reader with the provided initial and maximum positions.