All Packages Class Hierarchy This Package Previous Next Index
Class fi.faidon.util.ByteArrayConversion
java.lang.Object
|
+----fi.faidon.util.ByteArrayConversion
- public class ByteArrayConversion
- extends Object
Class that provides utilities for converting various data types to and
from byte-array presentation.
-
ByteArrayConversion()
-
-
bytesLEasINT(byte[], int, int)
- Return the int value given by the byte array in little-endian order.
-
bytesLEasUINT(byte[], int, int)
- Return the unsigned int value given by the byte array in little-endian (?) order.
-
intAsBytesLE(int, byte[], int, int)
- Return the int value given by the byte array in little-endian order.
-
uintAsBytesBE(int, byte[], int, int)
- Convert the int value into a byte array that starts from index "startOff" and
end at index "endOff" - 1 of "buf".
-
uintAsBytesLE(int, byte[], int, int)
- Convert the int value into a little-endian byte array that starts from
index "startOff" and end at index "endOff" - 1 of "buf".
-
ulongAsBytesBE(long, byte[], int, int)
- Convert the long value into a byte array that starts from index "startOff" and
end at index "endOff" - 1 of "buf".
ByteArrayConversion
public ByteArrayConversion()
bytesLEasUINT
public static int bytesLEasUINT(byte bytes[],
int start_offset,
int end_offset)
- Return the unsigned int value given by the byte array in little-endian (?) order.
bytesLEasINT
public static int bytesLEasINT(byte bytes[],
int start_offset,
int end_offset)
- Return the int value given by the byte array in little-endian order.
Here we interpret the first bit of the first byte as being a sign bit.
ulongAsBytesBE
public static void ulongAsBytesBE(long value,
byte bytes[],
int startOff,
int endOff)
- Convert the long value into a byte array that starts from index "startOff" and
end at index "endOff" - 1 of "buf". Bytes are in big-endian order.
uintAsBytesBE
public static void uintAsBytesBE(int value,
byte bytes[],
int startOff,
int endOff)
- Convert the int value into a byte array that starts from index "startOff" and
end at index "endOff" - 1 of "buf". Bytes are in big-endian order.
uintAsBytesLE
public static void uintAsBytesLE(int value,
byte bytes[],
int startOff,
int endOff)
- Convert the int value into a little-endian byte array that starts from
index "startOff" and end at index "endOff" - 1 of "buf".
intAsBytesLE
public static void intAsBytesLE(int value,
byte bytes[],
int startOffset,
int endOffset)
- Return the int value given by the byte array in little-endian order.
Here we interpret the first bit of the first byte as being a sign bit.
All Packages Class Hierarchy This Package Previous Next Index