public static int bytesToInt(final byte[] bytes){
  final ByteBuffer buffer=ByteBuffer.allocate(4);
  buffer.put(bytes,0,4);
  buffer.flip();
  return buffer.getInt();
}

public static int bytesToInt ( final byte [ ] bytes ) { final ByteBuffer buffer = ByteBuffer . allocate ( 4 ) ; buffer . put ( bytes , 0 , 4 ) ; buffer . flip ( ) ; return buffer . getInt ( ) ; }
converts an array of 4 bytes into a int .
