-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please implement a streaming interface for lz4-java #10
Comments
I agree this would be a good addition. However, the LZ4 format is not appropriate for streaming. For example, because the literal length must be encoded before the raw bytes, an uncompressible stream would require to buffer everything into memory before writing the length and flushing. See http://code.google.com/p/lz4/issues/detail?id=42&can=1 for more information. Eventually, there should be a streaming format with support for error detection, but I'm waiting for the original LZ4 implementation to implement this to keep API and format compatible. |
Well, appropriate or not, it's implemented; please see: You can take it or leave it. :-) |
Actually, I'm almost sold to add convenience classes to help people compress and decompress streams of data. I'm just a little worried LZ4 will eventually come out with a streaming format which doesn't match the one which you implemented and that might confuse users. I need to think a little more about the best way to do it. :-) |
Brian, I just committed LZ4BlockOutputStream and LZ4BlockInputStream in net.jpountz.lz4. Does it work for you? |
Hi Adrien,Wow, thanks for the quick turnaround. I'll take a look at this on Monday. I found a bug in my implementation with back-to-back flush()es. It looks like your implementation is immune to that particular bug, but I haven't looked too closely yet. Hoping this finds you well,b -------- Original Message -------- |
Hi Adrien, I've (visually) reviewed the code and it looks good to me. Unfortunately I can't test it by just dropping it into the currently released jar in maven. Would you consider another release? Thanks in advance, b |
Thanks for the review! Yes, I'm working on another release, I would just like to fix #8 first. |
I suggest this interface:
https://github.com/mooreb/lz4-java-stream
which implements LZ4InputStream, LZ4OutputStream and a test that verifies the streams work.
The text was updated successfully, but these errors were encountered: