private long readLogicalSize() throws IOException {
    Path storageFile = storage.getFile();
    Path lengthFile = deriveLengthFile();

    try (DataInputStream stream = new DataInputStream(Files.newInputStream(lengthFile, READ))) {
      return stream.readLong();
    }
    catch (IOException e) {
      long realSize = realSize();
      writeLogicalSize(realSize);
      LOG.info("Can't find .len file for " + storageFile + ", re-creating it from actual file. " +
               "Storage size = " + realSize + ", file size = " + Files.size(storageFile), e);
      return realSize;
    }
  }
private long readLogicalSize()