g1mv / density

Superfast compression library
Apache License 2.0
1.02k stars 48 forks source link

Improve the stream API's flexibility #9

Closed g1mv closed 9 years ago

g1mv commented 10 years ago

Make the stream API more similar to bzip2's in terms of flexibility

nemequ commented 9 years ago

Really the only thing that makes density's stream api hard to use is the fact that the output always has to be >= DENSITY_STREAM_MINIMUM_OUT_BUFFER_SIZE. That forces consumers to add a buffer, and either always pay for a memcpy or add complexity to switch back and forth between using the buffer and not using it.

Other than that, the only thing missing seems to be a flush operation. I'm not sure if that is feasible or not, but it's really only used for compressing a stream which runs over the network.

g1mv commented 9 years ago

Implemented in https://github.com/centaurean/density/commit/3c9267dfc2dc208dfda73226695548897d388de1