ulysseswu / lz4.frame Goto Github PK
View Code? Open in Web Editor NEW.NET lib for LZ4Frame
License: MIT License
.NET lib for LZ4Frame
License: MIT License
Hi
I am using your LZ4 library to decompress Lz4 blocks within a larger file stream.
The problem is that when I call Decompress, it closes the underlaying stream and I cannot continue reading it.
Could it be possible for you to add an aditional argument?
public static byte[] Decompress(Stream input, Boolean doNotCloseInputStream);
While decompressing several Lz4 blocks, I stumbled upon an uncompressed block, but lz4frame threw an exception.
Tracing the problem I found that this line of code:
if ((blockSize >> 31) == 1)
Is not working correctly. It seems that if blockSize is a SIGNED integer, shifting the bit down always produces zero, the result is that it neves enters inside the if block.
By replacing the line with:
if (blockSize < 0)
the decompressor works correctly.
On a side note, I was having issues with lz4net not being able to load the assembly due to net.standard / net.framework version mismatch. After some review I found lz4net.netcore.signed
which solves that problem (but your lz4frame still points to lz4net, which is a problem, I had to include your code directly)
Finally, I found why Milosz Krajewski is not updating the lz4net repository anymore... the reason seems to be he is starting from scratch a new Lz4 library here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.