Class NumberUtils
java.lang.Object
is.galia.util.NumberUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic intreadSignedInt(byte[] bytes, ByteOrder byteOrder) static longreadSignedLong(byte[] bytes, ByteOrder byteOrder) static intreadSignedShort(byte[] bytes, ByteOrder byteOrder) static longreadUnsignedInt(byte[] bytes, ByteOrder byteOrder) static intreadUnsignedShort(byte[] bytes, ByteOrder byteOrder) static byte[]toByteArray(int value, ByteOrder byteOrder) static byte[]toByteArray(long value, ByteOrder byteOrder)
-
Method Details
-
readSignedInt
- Parameters:
bytes- Array of 1 to 4 bytes. Bytes beyond these are ignored.byteOrder- Byte order of the array.- Returns:
- Signed value.
-
readSignedLong
- Parameters:
bytes- Array of 1 to 8 bytes. Bytes beyond these are ignored.byteOrder- Byte order of the array.- Returns:
- Signed value.
-
readSignedShort
- Parameters:
bytes- Array of 1 to 2 bytes. Bytes beyond these are ignored.byteOrder- Byte order of the array.- Returns:
- Signed value.
-
readUnsignedInt
- Parameters:
bytes- Array of 1 to 4 bytes. Bytes beyond these are ignored.byteOrder- Byte order of the array.- Returns:
- Unsigned value.
-
readUnsignedShort
- Parameters:
bytes- Array of 1 to 2 bytes. Bytes beyond these are ignored.byteOrder- Byte order of the array.- Returns:
- Unsigned value.
-
toByteArray
-
toByteArray
-