The following example shows converting a Byte array to Integer.
First create a ByteBuffer with given byte array and then read next 4 bytes from it as an Integer.
java.nio.ByteBuffer
public static ByteBuffer wrap(byte[] array) Wraps a byte array into a buffer.
public int getInt() Reads the next four bytes in the ByteBuffer as an Integer.