We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
With this code:
package main import ( "bytes" "fmt" lz4 "github.com/pierrec/lz4/v4" ) func main() { var dst bytes.Buffer zw := lz4.NewWriter(&dst) n, err := zw.Write([]byte("a")) fmt.Printf("First Write: n: %d, err: %v\n", n, err) fmt.Printf("dst after first Write(): %v\n", dst.Bytes()) zw.Flush() fmt.Printf("dst after Flush(): %v\n", dst.Bytes()) n, err = zw.Write([]byte("b")) fmt.Printf("Second Write: n: %d, err: %v\n", n, err) fmt.Printf("dst after second Write(): %v\n", dst.Bytes()) zw.Close() fmt.Printf("dst after Close(): %v\n", dst.Bytes()) }
You get:
First Write: n: 1, err: <nil> dst after first Write(): [4 34 77 24 100 112 185] dst after Flush(): [4 34 77 24 100 112 185 1 0 0 128 97] Second Write: n: 0, err: <nil> dst after second Write(): [4 34 77 24 100 112 185 1 0 0 128 97] dst after Close(): [4 34 77 24 100 112 185 1 0 0 128 97 0 0 0 0 86 116 13 85]
Notice second write returns 0 for number of bytes written, no error. And data isn't written.
After a Flush, it should be possible to write again, you would just get a new block.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
With this code:
You get:
Notice second write returns 0 for number of bytes written, no error. And data isn't written.
After a Flush, it should be possible to write again, you would just get a new block.
The text was updated successfully, but these errors were encountered: