Skip to content
This repository was archived by the owner on Dec 2, 2025. It is now read-only.
This repository was archived by the owner on Dec 2, 2025. It is now read-only.

Error to decompress Lz4 that was compressed with lz4-net in C# #194

Open

Description

@hermeswaldemarin

Hi ,

I'm facing a problem to decompress a object that was compressed by C# code using lz4-net.

I've tried all possibilities using many libraries and no one was able to decompress.

In my research I found that this .net library stores a header of 8 bytes. In this header they store the compression level, compressed length and original length of the object.

https://code.google.com/archive/p/lz4-net/

In object example I only was able to ready discarding some initial part of the byte[].

safeDecompressor.decompress(byteaero, 5, byteaero2.length - 5, restored, 0);

I was debuging the C# code and in their decompress implementation they are really handling this first bytes as headers.

image

The point is that I almost sure that in my example was needed only 4 bytes to store the header nedded, but my guess is that depends on the data size they will use more bytes to store the header, then I think that can be 3 to 8 bytes and the code needs to be smart to find this boundaries.

This Library was supposed to handle this type os compressing natively?

Am I doing something wrong?

image

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions