-
public class ByteArrayUtilsContains basic methods for reading/writing values to/from a
{@code byte[]}s and ByteArrayBuffers.
-
-
Method Summary
Modifier and Type Method Description static intreadUint16(ByteArrayBuffer bab, int off)Read a unsigned 16-bit value from a byte array buffer at a specifiedoffset as an int. static intreadUint16(Array<byte> buf, int off)Read a unsigned 16-bit value from a byte array at a specified offset asan int. static voidwriteUint16(ByteArrayBuffer bab, int off, int value)Writes a 16-bit unsigned integer into a byte array buffer at a specifiedoffset. static voidwriteUint16(Array<byte> buf, int off, int value)Writes a 16-bit unsigned integer into a byte array at a specified offset. static intreadUint24(ByteArrayBuffer bab, int off)Read a unsigned 24-bit value from a byte array buffer at a specifiedoffset as an int. static intreadUint24(Array<byte> buf, int off)Read a unsigned 24-bit value from a byte array at a specified offset asan int. static voidwriteUint24(ByteArrayBuffer bab, int off, int value)Writes a 24-bit unsigned integer into a byte array buffer at a specifiedoffset. static voidwriteUint24(Array<byte> buf, int off, int value)Writes a 24-bit unsigned integer into a byte array at a specified offset. static longreadUint32(ByteArrayBuffer bab, int off)Read a unsigned 32-bit value from a byte array buffer at a specifiedoffset as a {@code long}.static longreadUint32(Array<byte> buf, int off)Read a unsigned 32-bit value from a byte array at a specified offset asa {@code long}.static intreadInt(ByteArrayBuffer bab, int off)Read a 32-bit integer from a byte array buffer at a specified offset. static intreadInt(Array<byte> buf, int off)Read a 32-bit integer from a byte array at a specified offset. static voidwriteInt(ByteArrayBuffer bab, int off, int value)Writes an {@code int}into a byte array buffer at a specified offset.static voidwriteInt(Array<byte> buf, int off, int value)Writes an {@code int}into a byte array at a specified offset.static shortreadShort(ByteArrayBuffer bab, int off)Read a 16-bit signed integer from a byte array buffer at a specifiedoffset into a {@code short}.static shortreadShort(Array<byte> buf, int off)Read a 16-bit signed integer from a byte array at a specified offsetinto a {@code short}.static voidwriteShort(ByteArrayBuffer bab, int off, short value)Writes a {@code short}into a byte array buffer at a specified offset.static voidwriteShort(Array<byte> buf, int off, short value)Writes a {@code short}into a byte array at a specified offset.-
-
Method Detail
-
readUint16
static int readUint16(ByteArrayBuffer bab, int off)
Read a unsigned 16-bit value from a byte array buffer at a specifiedoffset as an int.
- Parameters:
bab- the buffer from which to read.off- start offset of the unsigned short
-
readUint16
static int readUint16(Array<byte> buf, int off)
Read a unsigned 16-bit value from a byte array at a specified offset asan int.
- Parameters:
buf- the buffer from which to read.off- start offset of the unsigned short
-
writeUint16
static void writeUint16(ByteArrayBuffer bab, int off, int value)
Writes a 16-bit unsigned integer into a byte array buffer at a specifiedoffset.
- Parameters:
bab- the byte array to write to.value- the value to write.
-
writeUint16
static void writeUint16(Array<byte> buf, int off, int value)
Writes a 16-bit unsigned integer into a byte array at a specified offset.
- Parameters:
buf- the byte array to write to.value- the value to write.
-
readUint24
static int readUint24(ByteArrayBuffer bab, int off)
Read a unsigned 24-bit value from a byte array buffer at a specifiedoffset as an int.
- Parameters:
bab- the buffer from which to read.off- start offset of the unsigned short
-
readUint24
static int readUint24(Array<byte> buf, int off)
Read a unsigned 24-bit value from a byte array at a specified offset asan int.
- Parameters:
buf- the buffer from which to read.off- start offset of the unsigned short
-
writeUint24
static void writeUint24(ByteArrayBuffer bab, int off, int value)
Writes a 24-bit unsigned integer into a byte array buffer at a specifiedoffset.
- Parameters:
bab- the byte array to write to.value- the value to write.
-
writeUint24
static void writeUint24(Array<byte> buf, int off, int value)
Writes a 24-bit unsigned integer into a byte array at a specified offset.
- Parameters:
buf- the byte array to write to.value- the value to write.
-
readUint32
static long readUint32(ByteArrayBuffer bab, int off)
Read a unsigned 32-bit value from a byte array buffer at a specifiedoffset as a
{@code long}.- Parameters:
bab- the buffer from which to read.off- start offset of the unsigned short
-
readUint32
static long readUint32(Array<byte> buf, int off)
Read a unsigned 32-bit value from a byte array at a specified offset asa
{@code long}.- Parameters:
buf- the buffer from which to read.off- start offset of the unsigned short
-
readInt
static int readInt(ByteArrayBuffer bab, int off)
Read a 32-bit integer from a byte array buffer at a specified offset.
- Parameters:
bab- the byte array from which to read.off- start offset in the buffer of the integer to be read.
-
readInt
static int readInt(Array<byte> buf, int off)
Read a 32-bit integer from a byte array at a specified offset.
- Parameters:
buf- the byte array from which to read.off- start offset in the buffer of the integer to be read.
-
writeInt
static void writeInt(ByteArrayBuffer bab, int off, int value)
Writes an
{@code int}into a byte array buffer at a specified offset.- Parameters:
bab- the byte array to write to.value- the value to write.
-
writeInt
static void writeInt(Array<byte> buf, int off, int value)
Writes an
{@code int}into a byte array at a specified offset.- Parameters:
buf- the byte array to write to.value- the value to write.
-
readShort
static short readShort(ByteArrayBuffer bab, int off)
Read a 16-bit signed integer from a byte array buffer at a specifiedoffset into a
{@code short}.- Parameters:
bab- the byte array from which to read.off- start offset in the buffer of the integer to be read.
-
readShort
static short readShort(Array<byte> buf, int off)
Read a 16-bit signed integer from a byte array at a specified offsetinto a
{@code short}.- Parameters:
buf- the byte array from which to read.off- start offset in the buffer of the integer to be read.
-
writeShort
static void writeShort(ByteArrayBuffer bab, int off, short value)
Writes a
{@code short}into a byte array buffer at a specified offset.- Parameters:
bab- the byte array to write to.value- the value to write.
-
writeShort
static void writeShort(Array<byte> buf, int off, short value)
Writes a
{@code short}into a byte array at a specified offset.- Parameters:
buf- the byte array to write to.value- the value to write.
-
-
-
-