private ByteRange getSegmentRange(final long segment) throws IOException {
        long from = windowByteStart;
        long to = windowByteEnd;

        if (segment > 0) {
            from = getOffset(segment - 1);
        }

        if (segment < count() - 1) {
            to = getOffset(segment);
        }

        return new ByteRange(from, to);
    }
This method gets the range of bytes covered by a particualar segment.
stroom-data/stroom-data-store-impl-fs/src/main/java/stroom/data/store/impl/fs/RASegmentInputStream.java