--- a/ZipStream.st Mon Feb 12 12:31:49 2007 +0100
+++ b/ZipStream.st Thu Feb 15 15:46:40 2007 +0100
@@ -9,7 +9,6 @@
other person. No title to or ownership of the software is
hereby transferred.
"
-
"{ Package: 'stx:libbasic2' }"
CompressionStream subclass:#ZipStream
@@ -86,19 +85,33 @@
examples
"
- [exBegin]
- |compressed zipStream|
+ [exBegin]
+ |compressedDataStream zipStream compressedData uncompressedData|
+
+ compressedDataStream := #[] writeStream.
+ zipStream := ZipStream writeOpenOn:compressedDataStream.
+ zipStream nextPutAll:'hallo Welt'.
+ zipStream close.
+
+ compressedData := compressedDataStream contents.
+
+ zipStream := ZipStream readOpenOn:(compressedData readStream).
-self halt.
- compressed := #[] writeStream.
- zipStream := self writeOpenOn:compressed.
- zipStream nextPutAll:'This is some text 1234567890'.
- zipStream flush.
- self information:'Compressed size: ', compressed contents size printString.
-self halt.
- zipStream := self readOpenOn:compressed contents readStream.
- self information:zipStream contents.
- [exEnd]
+ zipStream notNil ifTrue:[
+ |stream c|
+
+ stream := '' writeStream.
+
+ [ (c := zipStream next) notNil ] whileTrue:[
+ stream nextPut:c
+ ].
+ stream close.
+ uncompressedData := stream contents.
+ ].
+ ^ uncompressedData
+ [exEnd]
+
+
"
! !
@@ -713,7 +726,7 @@
!ZipStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/ZipStream.st,v 1.27 2007-01-17 13:47:40 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/ZipStream.st,v 1.28 2007-02-15 14:46:40 sr Exp $'
! !
ZipStream initialize!