public static final int getShort ( byte [ ] data , int offset ) { int result = 0 ; int i = offset ; for ( int shiftBy = 0 ; shiftBy < 16 ; shiftBy += 8 ) { result |= ( ( data [ i ] & 0xff ) ) << shiftBy ; ++ i ; } return result ; }
Read a two byte integer .