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

snappy golang compress and java uncompress don't work #175

Closed
jazzmr opened this issue May 3, 2017 · 5 comments
Closed

snappy golang compress and java uncompress don't work #175

jazzmr opened this issue May 3, 2017 · 5 comments

Comments

@jazzmr
Copy link

jazzmr commented May 3, 2017

I have a problem, golang compress and java uncompress, it don't work, what can I do with this problem

@tomwilkie
Copy link

I've reproduced this issue with a simple pair of programs: https://github.com/weaveworks-experiments/prometheus-benchmarks/tree/master/cmd/snappy

The output I get when encoding the string "hello world" in go is:

$ hexdump output
0000000 ff 06 00 00 73 4e 61 50 70 59 01 0f 00 00 00 7e
0000010 d8 6d 68 65 6c 6c 6f 20 77 6f 72 6c 64         
000001d

When I run the little java app, I get a java.io.IOException: FAILED_TO_UNCOMPRESS(5)

@tomwilkie
Copy link

Okay problem seems to be golang/snappy's framing format is not compatible with xerial/snappy-java. If you use golang snappy.Encode then the data can be decoded by xerial.

@xerial
Copy link
Owner

xerial commented May 22, 2017

@xerial xerial closed this as completed May 22, 2017
@kumari-jyoti
Copy link

Hi
I have data snappy compressed in java using org.xerial.snappy:snappy-java 1.1.7.2
I am trying to read in a golang service and decode it using github.com/eapache/go-xerial-snappy snappy.Decode
I am getting "malformed xerial framing"

Kindly note data is compressed properly as we have a live java service using it.
Kindly let me know how we can resolve this or this is not recommended and I will need to compress it using golang snappy. But it is an overhead for us.

@amlwwalker
Copy link

Did anyone get anywhere with this? I'm experiencing the same thing

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

No branches or pull requests

5 participants