code: public static short readShort(byte[] buf, int pos) {
      checkBoundary(buf, pos, 2);
      return (short) (((short) (buf[pos] & 0xff) << 8) | ((short) (buf[pos + 1] & 0xff)));
    }
docs: Reads a specific short byte value (2 bytes) from the input byte array at the given offset.
  
  @param buf input byte buffer
  @param pos offset into the byte buffer to read
  @return the short value read