org.knowceans.sandbox
Class IntByteArray
java.lang.Object
org.knowceans.sandbox.IntByteArray
public class IntByteArray
- extends java.lang.Object
Method Summary |
static int |
byteArrayToInt(byte[] b)
Convert the byte array to an int. |
static int |
byteArrayToInt(byte[] b,
int offset)
Convert the byte array to an int starting from the given offset. |
static byte[] |
intToByteArray(int value)
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IntByteArray
public IntByteArray()
main
public static void main(java.lang.String[] args)
intToByteArray
public static byte[] intToByteArray(int value)
byteArrayToInt
public static int byteArrayToInt(byte[] b)
- Convert the byte array to an int.
- Parameters:
b
- The byte array
- Returns:
- The integer
byteArrayToInt
public static int byteArrayToInt(byte[] b,
int offset)
- Convert the byte array to an int starting from the given offset.
- Parameters:
b
- The byte arrayoffset
- The array offset
- Returns:
- The integer