GZipReadStream, etc.

Andrew C. Greenberg werdna at gate.net
Sun Feb 6 07:43:46 UTC 2000


Thought I'd ask you directly to save some time.

How does one use GZipReadStream and GZipWriteStream to 
decompress/compress data stored in, say, a ByteArray?  My feeble 
efforts along the lines of:

| writer |
writer := GZipWriteStream on: (ByteArray new).
writer nextPutAll: stuff.
writer close.
writer contents

| writer |
writer := GZipWriteStream on: (WriteStream on: (ByteArray new)).
writer nextPutAll: stuff.
writer close.
writer contents

doesn't seem to be doing what I hoped it would be doing.  Either the 
data comes through uncompressed, doesn't come through at all, or it 
comes through smaller, but unreadable by GZReadStream.

Strangely, parallel code using FileStreams works flawlessly.

Am I missing something?





More information about the Squeak-dev mailing list