Paolo Bonzini wrote:
>> defl flush: Z_FULL_FLUSH.
>
> Seems like a good idea. One would have a #flush and a
#flushDictionary
> method for Z_SYNC_FLUSH and Z_FULL_FLUSH respectively,
if I understand
> correctly.
It turned out to be a little complicated because I was lazy
and I didn't
implement the ZLibWriteStream, so to speak, directly.
Instead I used an
adaptor class that took the ReadStream decorator (the one
used for
DeflateStream on: 'aaa') and transformed it into a
WriteStream decorator.
This was perfectly fine with the existing set of
functionality but now
the problem, of course, is that the ReadStream decorator
cannot know the
boundary at which flushing will occur. The solution is to
write a real
WriteStream decorator for zlib -- luckily, quite a lot of
common code
can be factored into an abstract superclass used by both the
ReadStream
decorator and WriteStream decorator.
The boring buffering code is already there FileStream. It
should be
copied over to the TCP buffering code as well, as it would
speed up
#nextPutAll: on a socket consistently; and maybe the ZLib
bindings
themselves could use the ReadBuffer and WriteBuffer classes
that sockets
use. Something for another day, though.
The C interface was almost ready; the only thing missing was
the ability
to deflate/inflate an incomplete buffer.
Thanks for this request, it is indeed a useful one!
Paolo
_______________________________________________
help-smalltalk mailing list
help-smalltalk gnu.org
http://lists.gnu.org/mailman/listinfo/help-smalltalk
|