code: public void seek(long pos) throws IOException {
      if (pos >= this.hi_ || pos < this.lo_) {
        // seeking outside of current buffer -- flush and read
        this.flushBuffer();
        this.lo_ = pos & BuffMask_; // start at BuffSz boundary
        this.maxHi_ = this.lo_ + (long) this.buff_.length;
        if (this.diskPos_ != this.lo_) {
          super.seek(this.lo_);
          this.diskPos_ = this.lo_;
        }
        int n = this.fillBuffer();
        this.hi_ = this.lo_ + (long) n;
      } else {
        // seeking inside current buffer -- no read required
        if (pos < this.curr_) {
          // if seeking backwards, we must flush to maintain V4
          this.flushBuffer();
        }
      }
      this.curr_ = pos;
    }
docs: /*
  This method positions <code>this.curr</code> at position <code>pos</code>.
  If <code>pos</code> does not fall in the current buffer, it flushes the
  current buffer and loads the correct one.<p>
  
  On exit from this routine <code>this.curr == this.hi</code> iff <code>pos</code>
  is at or past the end-of-file, which can only happen if the file was
  opened in read-only mode.