'From etoys3.0 of 24 February 2008 [latest update: #1966] on 11 April 2008 at 2:27:42 pm'! "Change Set: RemoveProgress-cjs Date: 11 April 2008 Author: Ties Stuji Replace uptoEndWithProgressBar with upToEnd."! !ReadWriteStream methodsFor: 'converting' stamp: 'cjs 3/16/2008 17:29'! asUnZippedStream | isGZip outputStream first strm archive which | "Decompress this file if needed, and return a stream. No file is written. File extension may be .gz or anything else. Also works on archives (.zip, .gZip)." strm _ self binary. strm isZipArchive ifTrue: [ archive _ ZipArchive new readFrom: strm. which _ archive members detect: [:any | any fileName asLowercase endsWith: '.ttf'] ifNone: [nil]. which ifNil: [archive close. ^ self error: 'Can''t find .ttf file in archive']. strm _ which contentStream. archive close]. first _ strm next. isGZip _ (strm next * 256 + first) = (GZipConstants gzipMagic). strm skip: -2. isGZip ifTrue: [outputStream _ (MultiByteBinaryOrTextStream with: (GZipReadStream on: strm) upToEnd) reset. strm close] ifFalse: [outputStream _ strm]. ^ outputStream! !