org.knowceans.sandbox
Class IntByteArray

java.lang.Object
  extended by org.knowceans.sandbox.IntByteArray

public class IntByteArray
extends java.lang.Object


Constructor Summary
IntByteArray()
           
 
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
 

Constructor Detail

IntByteArray

public IntByteArray()
Method Detail

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 array
offset - The array offset
Returns:
The integer