@Override
  public InputStream readStream(int recordId) throws IOException {
    long storageId = contentIdToStorageId(recordId);
    byte[] bytes = contentStorage.read(storageId, buffer -> {
      //record: cryptoHash[CONTENT_HASH_LENGTH], uncompressedSize(int32), contentBytes[*]
      buffer.position(CONTENT_HASH_LENGTH);//skip crypto-hash
      int uncompressedSize = buffer.getInt();
      if (uncompressedSize >= 0) { //not compressed data
        int contentSize = buffer.remaining();
        byte[] contentBytes = new byte[contentSize];
        buffer.get(contentBytes);
        return contentBytes;
      }
      else {// [uncompressedSize<0] => compressed data
        int actualUncompressedSize = -uncompressedSize;
        byte[] bufferForDecompression = new byte[actualUncompressedSize];

        long startedAtNs = System.nanoTime();
        compressingAlgo.decompress(buffer, bufferForDecompression);
        long decompressionTimeNs = System.nanoTime() - startedAtNs;

        recordsReadDecompressionTimeNs.addAndGet(decompressionTimeNs);
        recordsReadDecompressed.incrementAndGet();

        return bufferForDecompression;
      }
    });

    recordsRead.incrementAndGet();
    recordsReadUncompressedSize.addAndGet(bytes.length);


    //MAYBE RC: introduce 'VIGILANT' option there we always check crypto-hash of read/decompressed data
    //          against crypto-hash stored?
    return new UnsyncByteArrayInputStream(bytes);
  }
@Override
  public InputStream readStream(int recordId)