#TUNING by stefan
class: ZipArchive
changed: #decode:method:size:asString: (send #uninitializedNew: instead of #new:)
--- a/ZipArchive.st Sat Sep 28 15:57:34 2019 +0200
+++ b/ZipArchive.st Sat Sep 28 16:01:24 2019 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 1998 by eXept Software AG
All Rights Reserved
@@ -3632,55 +3630,55 @@
|outBytes|
compressionMethod == COMPRESSION_STORED ifTrue:[
- "/
- "/ uncompressed
- "/
- asString ifTrue:[^ rawBytes asString].
- ^ rawBytes
+ "/
+ "/ uncompressed
+ "/
+ asString ifTrue:[^ rawBytes asString].
+ ^ rawBytes
].
compressionMethod == COMPRESSION_DEFLATED ifTrue:[
- "/
- "/ deflate/inflate algorithm
- "/
- asString ifTrue:[
- outBytes := String new:uncompressedSize.
- ] ifFalse:[
- outBytes := ByteArray new:uncompressedSize.
- ].
- ^ self inflate:rawBytes to:outBytes
+ "/
+ "/ deflate/inflate algorithm
+ "/
+ asString ifTrue:[
+ outBytes := String uninitializedNew:uncompressedSize.
+ ] ifFalse:[
+ outBytes := ByteArray uninitializedNew:uncompressedSize.
+ ].
+ ^ self inflate:rawBytes to:outBytes
].
"/
"/ the other algorithms are not (yet) supported
"/
compressionMethod == COMPRESSION_SHRUNK ifTrue:[
- self error:'unsupported compression method: SHRUNK'.
- ^ nil
+ self error:'unsupported compression method: SHRUNK'.
+ ^ nil
].
compressionMethod == COMPRESSION_REDUCED1 ifTrue:[
- self error:'unsupported compression method: REDUCED1'.
- ^ nil
+ self error:'unsupported compression method: REDUCED1'.
+ ^ nil
].
compressionMethod == COMPRESSION_REDUCED2 ifTrue:[
- self error:'unsupported compression method: REDUCED2'.
- ^ nil
+ self error:'unsupported compression method: REDUCED2'.
+ ^ nil
].
compressionMethod == COMPRESSION_REDUCED3 ifTrue:[
- self error:'unsupported compression method: REDUCED3'.
- ^ nil
+ self error:'unsupported compression method: REDUCED3'.
+ ^ nil
].
compressionMethod == COMPRESSION_REDUCED4 ifTrue:[
- self error:'unsupported compression method: REDUCED4'.
- ^ nil
+ self error:'unsupported compression method: REDUCED4'.
+ ^ nil
].
compressionMethod == COMPRESSION_IMPLODED ifTrue:[
- self error:'unsupported compression method: IMPLODED'.
- ^ nil
+ self error:'unsupported compression method: IMPLODED'.
+ ^ nil
].
compressionMethod == COMPRESSION_TOKENIZED ifTrue:[
- self error:'unsupported compression method: TOKENIZED'.
- ^ nil
+ self error:'unsupported compression method: TOKENIZED'.
+ ^ nil
].
self error:'unsupported compression method'.
@@ -3688,6 +3686,7 @@
"Created: / 29-03-1998 / 20:14:45 / cg"
"Modified: / 19-11-2010 / 15:39:49 / cg"
+ "Modified: / 24-09-2019 / 16:28:35 / Stefan Vogel"
!
inflate:inBytes to:outBytes