Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo committed Jul 20, 2024
1 parent f1f65a8 commit a24cfef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ int uncompressedSize = decompressor.decompress(compressed, 0, compressedSize, un
Arena arena = ...
MemorySegment data = ...

Compressor compressor = new Lz4JavaCompressor();
Compressor compressor = Lz4Compressor.create();
MemorySegment compressed = arena.allocate(compressor.maxCompressedLength(toIntExact(data.byteSize())));
int compressedSize = compressor.compress(data, compressed);
compressed = compressed.asSlice(0, compressedSize);

Decompressor decompressor = new Lz4JavaDecompressor();
Decompressor decompressor = Lz4Decompressor.create();
MemorySegment uncompressed = arena.allocate(data.byteSize());
int uncompressedSize = decompressor.decompress(compressed, uncompressed);
uncompressed = uncompressed.asSlice(0, uncompressedSize);
Expand Down

0 comments on commit a24cfef

Please sign in to comment.