Skip to content
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

Check if Snappy Compressed Stream? #1

Open
kevinmeredith opened this issue Feb 18, 2015 · 3 comments
Open

Check if Snappy Compressed Stream? #1

kevinmeredith opened this issue Feb 18, 2015 · 3 comments

Comments

@kevinmeredith
Copy link

How can I check if data is snappy compressed in the Stream format?

https://github.com/kesla/node-snappy provides isValidSnappyCompressed(input, callback).

Perhaps there's something similar for this library?

Thanks

@kesla
Copy link
Owner

kesla commented Feb 19, 2015

No, not currently. Should be fairly simple to do, I'd gladly give you some pointers if you'd like to contribute it. Otherwise I can definitely take a look at it when I have the time :)

@kevinmeredith
Copy link
Author

Thanks for the quick reply, @kesla.

So, if I had a text file that may or may not be compressed with Snappy Stream, I could try to de-compress it. And, if it were not compressed, then an Exception would be thrown? Otherwise, if it were compressed, I could get back the un-compressed text file?

@kesla
Copy link
Owner

kesla commented Feb 21, 2015

Yeah, the stream will emit an error when trying to decompress something that isn't wrong.

TBH, I don't really get why you'd get a stream that might not be streamed? Would be interesting to hear the use case :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants