public class

ByteArray

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.io.ByteArray

Class Overview

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.

Summary

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

Public Constructors

public ByteArray (byte[] bytes)

Create a little-endian byte[] reader with an initial index of 0.

public ByteArray (byte[] bytes, int pos)

Create a little-endian byte[] reader with the provided initial index.

public ByteArray (byte[] bytes, int pos, int maxpos)

Create a little-endian byte[] reader with the provided initial and maximum positions.

Public Methods

public int available ()

public byte[] bytes ()

public ByteArray copy (int index, int maxindex)

public ByteArray copy (int index)

public ByteArray copy ()

public byte get ()

public byte[] get (int cnt)

public int i16 ()

public int i32 ()

public long i64 ()

public int i8 ()

public int maxPosition ()

public int maxPosition (int pos)

public int position (int pos)

public int position ()

public void skip (int cnt)

public String toString ()

public int u16 ()

public int u31 ()

public long u32 ()

public long u63 ()

public int u8 ()

public int vari32 ()

public long vari64 ()

public int varu16 ()

public long varu32 ()