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

bytewise difference between this package and the CLI #35

Open
laszbalo opened this issue Jun 6, 2022 · 1 comment
Open

bytewise difference between this package and the CLI #35

laszbalo opened this issue Jun 6, 2022 · 1 comment

Comments

@laszbalo
Copy link

laszbalo commented Jun 6, 2022

Hi,

I created a bunch of compressed files with the help of your package (version 1.0.4). I can decompress them with your library, however I am failing to decompress them with the CLI (neither with version 1.0.7, nor with 1.0.9). Interestingly, your library is able to decompress the brotli files which were created with the CLI.

The brotli files that are produced by both your library and CLI have the same file size, however they differ in content(when I do a byte-wise comparison).

This is how I compress my files with you library:

bw := brotli.NewWriterLevel(&buf, brotli.BestCompression)

Using the CLI:

$ brotli foo.html -o foo.html.br

Decompressing them with your library:

br := brotli.NewReader(os.Stdin)
_, err := io.Copy(os.Stdout, br)

Decompressing with the CLI:

cat foo.html.br | brotli --decompress

Am I doing something wrong here?

@andybalholm
Copy link
Owner

Do you close the brotli.Writer after you're done writing to it?

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

2 participants