go-zlib
go-zlib copied to clipboard
ReadBuffer takes too long if compressed data > 90kb
What should I do if I don't know the uncompressed size? ReadBuffer takes too long if compressed data > 90kb with nil out, should I make a big enough out like this:
out := make([]byte, 1000000) n, _, err := zr.ReadBuffer(message, out) fmt.Printf("message read: %d, decoded message: %s, err: %v\n", n, out, err)
But how large should I make out? Is there any other method to decompress the data in one go?
edit: ReadBuffer will block if nil out