private static int intFromSubArray ( final byte [ ] bytes , final int from , final int to ) { final byte [ ] subBytes = Arrays . copyOfRange ( bytes , from , to ) ; final ByteBuffer wrap = ByteBuffer . wrap ( subBytes ) ; return wrap . getInt ( ) ; }
Take a slice of an array of bytes and interpret it as an int .