code: public void seek(int offset) throws IOException {
      if (!(offset >= bufferOffset && offset < bufferOffset + maxBufferSize)) {
        writeBuffer();
        newBuffer(offset);
        aFile.seek(offset);
      }
      position = offset;
    }
docs: Seek.
  
  @param offset the offset
  @throws IOException Signals that an I/O exception has occurred.