protected @NotNull InputStream getChunkInputStream(long offset, int pageSize) throws IOException {
    InputStream in = Files.newInputStream(getChunksFile());
    long toSkip = offset;
    while (toSkip > 0) {
      long skipped = in.skip(toSkip);
      if (skipped == 0) {
        throw new EOFException("Unable to skip " + offset + " bytes: end-of-file reached");
      }
      toSkip -= skipped;
    }
    return new BufferedInputStream(new LimitedInputStream(in, pageSize) {
      @Override
      public int available() {
        return remainingLimit();
      }
    }, pageSize);
  }
protected @NotNull InputStream getChunkInputStream(long offset, int pageSize)