stream/distributedlog/io/dlfs/src/main/java/org/apache/distributedlog/fs/DLInputStream.java [93:137]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void seek(long pos) throws IOException {
        if (this.pos == pos) {
            return;
        }

        if (this.pos > pos || (pos - this.pos) >= REOPEN_READER_SKIP_BYTES) {
            // close the previous reader
            this.reader.close();
            this.reader = dlm.openLogReader(pos);
            this.currentRecord = null;
        }

        skipTo(pos);
    }

    private boolean skipTo(final long position) throws IOException {
        while (true) {
            if (null == currentRecord) {
                currentRecord = nextRecordStream(reader);
            }

            if (null == currentRecord) { // the stream is empty now
                return false;
            }

            long endPos = currentRecord.record.getTransactionId();
            if (endPos < position) {
                currentRecord = nextRecordStream(reader);
                this.pos = endPos;
                continue;
            } else if (endPos == position){
                // find the record, but we defer read next record when actual read happens
                this.pos = position;
                this.currentRecord = null;
                return true;
            } else {
                this.currentRecord.payloadStream.skip(
                    this.currentRecord.payloadStream.available() - (endPos - position));
                this.pos = position;
                return true;
            }
        }
    }

    @Override
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



stream/statelib/src/main/java/org/apache/bookkeeper/statelib/impl/rocksdb/checkpoint/dlog/DLInputStream.java [91:139]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void seek(long pos) throws IOException {
        if (this.pos == pos) {
            return;
        }

        if (this.pos > pos || (pos - this.pos) >= REOPEN_READER_SKIP_BYTES) {
            // close the previous reader
            this.reader.close();
            this.reader = dlm.openLogReader(pos);
            this.currentRecord = null;
        }

        skipTo(pos);
    }

    private boolean skipTo(final long position) throws IOException {
        while (true) {
            if (null == currentRecord) {
                currentRecord = nextRecordStream(reader);
            }

            if (null == currentRecord) { // the stream is empty now
                return false;
            }

            long endPos = currentRecord.record.getTransactionId();
            if (endPos < position) {
                currentRecord = nextRecordStream(reader);
                this.pos = endPos;
                continue;
            } else if (endPos == position){
                // find the record, but we defer read next record when actual read happens
                this.pos = position;
                this.currentRecord = null;
                return true;
            } else {
                this.currentRecord.payloadStream.skip(
                    this.currentRecord.payloadStream.available() - (endPos - position));
                this.pos = position;
                return true;
            }
        }
    }

    //
    // Input Stream
    //

    @Override
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



