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

Decompressed data not matching original data #8

Open
StefanMenne opened this issue Sep 16, 2014 · 0 comments
Open

Decompressed data not matching original data #8

StefanMenne opened this issue Sep 16, 2014 · 0 comments

Comments

@StefanMenne
Copy link

The native implementation does sometimes not restore the original data when compressing and then decompressing.

      byte[] uncompressed   = new byte[] { 5,0,5,0,6,0,6,0,5,0,
                                                                5,0,5,0,5,0,5,0,6,0,
                                                                   6,0,5,0,5,0,5,0,5,0,
                                   5,0,5,0,5,0,5,0,5,0,
                                   5,0,5,0,4,0,5,0,5,0,
                                   5,0,5,0,5,0,4,0,5,0,
                                   5,0,5,0,5,0,5,0,4,0,
                                   5,0,5,0,5,0,5,0,5,0,
                                   5,0};
      byte[] compressed     = new byte[100];

      Snappy.Sharp.SnappyCompressor snappyCompressor = new Snappy.Sharp.SnappyCompressor();
      int countBytes = snappyCompressor.Compress( uncompressed, 0, uncompressed.Length, compressed, 0 );






      Snappy.Sharp.SnappyDecompressor snappyDecompressor = new Snappy.Sharp.SnappyDecompressor();

      byte[] uncompressed2 = snappyDecompressor.Decompress( compressed, 0, countBytes );

The last bytes are corrupted. The compression/decompression works fine for several similar data packages but after approx. 100 packages the above data produces corrupt data.

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

1 participant