code: public short readShort() throws IOException {
          int byte1 = in.read();
          int byte2 = in.read();
  
          // only need to test last byte read
          // if byte1 is -1 so is byte2
          if (byte2 < 0) {
              throw new EOFException();
          }
  
          return (short) (((byte2 << 24) >>> 16) | (byte1 << 24) >>> 24);
      }
docs: Reads a two byte signed {@code short} from the underlying
  input stream in little endian order, low byte first.
  
  @return the {@code short} read.
  @throws EOFException if the end of the underlying input stream
  has been reached
  @throws IOException  if the underlying stream throws an IOException.