@Override
    public boolean contains(long offset) {
        return (this.getCachedSize() == 0
                && offset == this.start
                || this.getCachedSize() > 0
                        && offset >= this.start
                        && offset <= this.start + this.getCachedSize() - 1);
    }
Flush file cache to disk.

@param force whether to brush
@return the latest writable position

@throws IOException exception while force data to disk
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/broker/msgstore/disk/FileSegment.java