[squeak-dev] The Trunk: Compression-ar.22.mcz
commits at source.squeak.org
commits at source.squeak.org
Sun Sep 5 17:53:44 UTC 2010
Andreas Raab uploaded a new version of Compression to project The Trunk:
http://source.squeak.org/trunk/Compression-ar.22.mcz
==================== Summary ====================
Name: Compression-ar.22
Author: ar
Time: 5 September 2010, 10:53:14.026 am
UUID: 579fde37-ea30-f14a-9799-a08eb7eac29f
Ancestors: Compression-ar.21
Restructurings to reduce package depencencies.
=============== Diff against Compression-ar.21 ===============
Item was changed:
----- Method: GZipWriteStream class>>initialize (in category 'class initialization') -----
initialize
+ FileServices registerFileReader: self!
- FileList registerFileReader: self!
Item was added:
+ ----- Method: StandardFileStream>>compressFile (in category '*Compression') -----
+ compressFile
+ "Write a new file that has the data in me compressed in GZip format."
+ | zipped buffer |
+
+ self readOnly; binary.
+ zipped := self directory newFileNamed: (self name, FileDirectory dot, 'gz').
+ zipped binary; setFileTypeToObject.
+ "Type and Creator not to be text, so can be enclosed in an email"
+ zipped := GZipWriteStream on: zipped.
+ buffer := ByteArray new: 50000.
+ 'Compressing ', self fullName displayProgressAt: Sensor cursorPoint
+ from: 0 to: self size
+ during: [:bar |
+ [self atEnd] whileFalse: [
+ bar value: self position.
+ zipped nextPutAll: (self nextInto: buffer)].
+ zipped close.
+ self close].
+ ^zipped!
Item was changed:
----- Method: GZipWriteStream class>>unload (in category 'class initialization') -----
unload
+ FileServices unregisterFileReader: self!
- FileList unregisterFileReader: self!
Item was added:
+ ----- Method: FileStream>>viewGZipContents (in category '*Compression') -----
+ viewGZipContents
+ "View the contents of a gzipped file"
+
+ | stringContents |
+ self binary.
+ stringContents := self contentsOfEntireFile.
+ stringContents := Cursor wait showWhile: [(GZipReadStream on: stringContents) upToEnd].
+ stringContents := stringContents asString withSqueakLineEndings.
+
+ UIManager default
+ edit: stringContents;
+ label: 'Decompressed contents of: ', self localName!
Item was changed:
----- Method: GZipReadStream class>>unload (in category 'class initialization') -----
unload
+ FileServices unregisterFileReader: self !
- FileList unregisterFileReader: self !
More information about the Squeak-dev
mailing list
|