public static short toShort(byte[] bytes,int offset){
  if (littleEndian) {
    return Short.reverseBytes(theUnsafe.getShort(bytes,offset + BYTE_ARRAY_BASE_OFFSET));
  }
 else {
    return theUnsafe.getShort(bytes,offset + BYTE_ARRAY_BASE_OFFSET);
  }
}

public static short toShort ( byte [ ] bytes , int offset ) { if ( littleEndian ) { return Short . reverseBytes ( theUnsafe . getShort ( bytes , offset + BYTE_ARRAY_BASE_OFFSET ) ) ; } else { return theUnsafe . getShort ( bytes , offset + BYTE_ARRAY_BASE_OFFSET ) ; } }
converts a byte array to a short value considering it was written in big - endian format .
