-
- All Implemented Interfaces:
public class ByteArrayUtilsContains basic methods for reading/writing values to/from a
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 specified offset as an int. static intreadUint16(Array<byte> buf, int off)Read a unsigned 16-bit value from a byte array at a specified offset as an int. static voidwriteUint16(ByteArrayBuffer bab, int off, int value)Writes a 16-bit unsigned integer into a byte array buffer at a specified offset. 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 specified offset as an int. static intreadUint24(Array<byte> buf, int off)Read a unsigned 24-bit value from a byte array at a specified offset as an int. static voidwriteUint24(ByteArrayBuffer bab, int off, int value)Writes a 24-bit unsigned integer into a byte array buffer at a specified offset. 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 specified offset as a long.static longreadUint32(Array<byte> buf, int off)Read a unsigned 32-bit value from a byte array at a specified offset as a 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 intinto a byte array buffer at a specified offset.static voidwriteInt(Array<byte> buf, int off, int value)Writes an intinto 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 specified offset into a short.static shortreadShort(Array<byte> buf, int off)Read a 16-bit signed integer from a byte array at a specified offset into a short.static voidwriteShort(ByteArrayBuffer bab, int off, short value)Writes a shortinto a byte array buffer at a specified offset.static voidwriteShort(Array<byte> buf, int off, short value)Writes a shortinto 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 specified offset 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 as an 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 specified offset.
- 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 specified offset 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 as an 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 specified offset.
- 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 specified offset as a
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 as a
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
intinto 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
intinto 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 specified offset into a
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 offset into a
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
shortinto 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
shortinto a byte array at a specified offset.- Parameters:
buf- the byte array to write to.value- the value to write.
-
-
-
-