Class NumberUtils
java.lang.Object
is.galia.util.NumberUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
readSignedInt
(byte[] bytes, ByteOrder byteOrder) static long
readSignedLong
(byte[] bytes, ByteOrder byteOrder) static int
readSignedShort
(byte[] bytes, ByteOrder byteOrder) static long
readUnsignedInt
(byte[] bytes, ByteOrder byteOrder) static int
readUnsignedShort
(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
-