private static short getAsShort(ByteBuffer buf, int offset) {
    if (buf.isDirect()) {
      return HBasePlatformDependent.getShort(directBufferAddress(buf) + offset);
    }
    return HBasePlatformDependent.getShort(buf.array(),
      BYTE_ARRAY_BASE_OFFSET + buf.arrayOffset() + offset);
  }
Reads bytes at the given offset as a short value.
@return short value at offset
hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java