OK, compressBound is in compress.c and differs from deflateBound which
is in deflate.c in that compressBound only gives the less conservative
estimate and deflateBound uses the z_stream parameters to get a better
idea of what the constraint is going to be.
The code I'm porting from uses compressBound and this allows some
liberal assumption to be made about the input buffer size that using the
conservative constraint of deflateBound would not (the input buffer
would need to be smaller).
I'm not sure that this would necessarily cause a problem, but I'd rather
avoid it.
I don't know enough about how the Go standard library's flate
compression differs from the zlib compress algorithm (does zlib use
flate in compress.c?) to know which is safe.
Perhaps an approach is just to fill buffers and try compression with
various settings to see if I can get a failure (the package does check
after compression to catch these failures, but it would be nice to know
up front).
Any ideas?
thanks
Dan