DeflateStream unable to write binary streams?

Matthew Fulmer tapplek at gmail.com
Wed Sep 26 05:42:35 UTC 2007


I was playing with GZipWriteStream and ZLibWriteStream, trying
to write compressed binary data in the middle of a chunk file,
like so:

writeDelta: aDelta
    stream nextPutAll: '!DSBinStReader new!'.
    (DataStream on: (GZipWriteStream on: stream)) nextPut: aDelta

This didn't work at all. First, GZipWriteStream wasn't even
writing to the stream, but to it's own internal collection.
DeflateStreams seem to try to seize control of the entire
underlying stream or collection. 

Second, it wouldn't accept the binary data that DataStream was
feeding it. It seems to only accept character data, as sending
the message #binary to a DeflateStream does nothing.

So, should DeflateStreams be general purpose streams, or is
there a good reason they are text-only and not embeddable?

-- 
Matthew Fulmer -- http://mtfulmer.wordpress.com/
Help improve Squeak Documentation: http://wiki.squeak.org/squeak/808



More information about the Squeak-dev mailing list