[Cuis-dev] Documentation on the Compression package

Juan Vuletich juan at cuis.st
Wed Mar 25 08:39:16 PDT 2026


Hi Hilaire,

This looks very useful!

On 2026-03-19 6:00 PM, Hilaire Fernandes via Cuis-dev wrote:
>
> And for the record, the counter part to read back:
>
> restoreFromCompressedFile: aFileEntry     ^ aFileEntry readStreamDo: [ 
> :fileStream | | uncompressed |         uncompressed := (GZipReadStream 
> on: fileStream) upToEnd.         self unStream: (self unStream: 
> uncompressed)]
>
>
> Don't ask me why the double unStream:...
>
It is because you're streaming twice too.

I'd rather prefer

dumpOnCompressedFile: aFileEntry object: anObject
     "Warning: If the file given by aFileEntry exists, it will be 
overwritten."

     aFileEntry forceWriteStreamDo: [ :fileStream | | compressor |
         compressor := GZipWriteStream on: fileStream.
         compressor nextPutAll: (self streamedRepresentationOf: anObject).
         compressor close]

and

restoreFromCompressedFile: aFileEntry
     ^ aFileEntry readStreamDo: [ :fileStream | | uncompressed |
         uncompressed := (GZipReadStream on: fileStream) upToEnd.
         self unStream: uncompressed]

If you agreen, I can push these to the Compression package.

Thanks,

> -- 
> http://mamot.fr/@drgeo
>
-- 
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260325/82677fb1/attachment.htm>


More information about the Cuis-dev mailing list