public class OctetUtil extends Object
Constructor and Description |
---|
OctetUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
bytesToInt(byte[] bytes)
32 bit.
|
static int |
bytesToInt(byte[] bytes,
int offset)
32 bit.
|
static short |
bytesToShort(byte[] bytes)
16 bit.
|
static short |
bytesToShort(byte[] bytes,
int offset)
16 bit.
|
static byte[] |
intToBytes(int value)
Convert integer (4 octets) value to bytes.
|
static byte[] |
shortToBytes(short value)
Convert integer (2 octets) value to bytes.
|
public static byte[] intToBytes(int value)
value
- as 4 bytes representing integer in bytes.public static byte[] shortToBytes(short value)
value
- public static int bytesToInt(byte[] bytes)
bytes
- public static int bytesToInt(byte[] bytes, int offset)
bytes
- offset
- public static short bytesToShort(byte[] bytes)
bytes
- public static short bytesToShort(byte[] bytes, int offset)
bytes
- offset
-