4179 "Modified: / 17-02-2017 / 22:57:43 / stefan" |
4179 "Modified: / 17-02-2017 / 22:57:43 / stefan" |
4180 ! ! |
4180 ! ! |
4181 |
4181 |
4182 !ZipArchive methodsFor:'reading - stream'! |
4182 !ZipArchive methodsFor:'reading - stream'! |
4183 |
4183 |
4184 extract:fileName intoStream: aWriteStream |
4184 extract:fileName intoStream:aWriteStream |
4185 "extract an entry indentified by filename into aWriteStream" |
4185 "extract an entry identified by filename into aWriteStream" |
4186 |
4186 |
4187 self |
4187 self |
4188 withPositionAndMemberFor:fileName |
4188 withPositionAndMemberFor:fileName |
4189 do:[:zmemb :position | |
4189 do:[:zmemb :position | |
4190 |buffer rdSize compressionMethod nextBlockSize streamBufferSize myZipStream| |
4190 |buffer rdSize compressionMethod nextBlockSize streamBufferSize myZipStream| |
4191 |
4191 |
4192 stream position:position. |
4192 stream position:position. |
4193 |
4193 |
4194 compressionMethod := zmemb compressionMethod. |
4194 compressionMethod := zmemb compressionMethod. |
4195 rdSize := zmemb uncompressedSize. |
4195 rdSize := zmemb uncompressedSize. |
4196 nextBlockSize := streamBufferSize := self class streamBufferSize. |
4196 nextBlockSize := streamBufferSize := self class streamBufferSize. |
4197 buffer := ByteArray new: streamBufferSize. |
4197 buffer := ByteArray new: streamBufferSize. |
4198 [ |
4198 [ |
4199 [rdSize > 0] whileTrue: [ |
4199 [rdSize > 0] whileTrue: [ |
4200 rdSize < streamBufferSize ifTrue: [ |
4200 rdSize < streamBufferSize ifTrue: [ |
4201 nextBlockSize := rdSize. |
4201 nextBlockSize := rdSize. |