public static short byteArrayToShort(byte[] b, int offset) {
    short value = 0;
    value += (b[offset] & 0x000000FF) << 8;
    value += (b[offset + 1] & 0x000000FF);
    return value;
  }
Convert the byte array to a short starting from the given offset.

@param b
         the byte array
@param offset
         the array offset
@return the short
serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinaryUtils.java