code: public int read(long offset) throws IOException {
      int b;
      if (maxBufferSize <= 0) {
        // old-school (no buffer optimization)
        b = input.read();
      } else {
        checkBuffer(offset);
        b = buffer[(int) (offset - bufferOffset)];
      }
      if (b < 0) return 256+b;
      return b;
    }
docs: Reads a byte.
  
  @param offset the offset
  @return the byte
  @throws IOException Signals that an I/O exception has occurred.