#REFACTORING
authorClaus Gittinger <cg@exept.de>
Sun, 14 Feb 2016 00:17:27 +0100
changeset 3555 7c304f9f757f
parent 3554 f1820748e4a9
child 3556 c2c45185ef9d
child 3557 dc0c5f9000c2
#REFACTORING class: MacOSXIconReader changed: #fromStream: (send #nextUnsignedInt32MSB: instead of #nextUnsignedLongMSB:) #saveAll:onStream: (send #nextPutInt32:MSB: instead of #nextPutLong:MSB:) removed remaining references to obsolete inhomogenous writers and readers.
MacOSXIconReader.st
--- a/MacOSXIconReader.st	Sun Feb 14 00:17:17 2016 +0100
+++ b/MacOSXIconReader.st	Sun Feb 14 00:17:27 2016 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 2013 by Claus Gittinger
               All Rights Reserved
@@ -116,7 +114,7 @@
         ^ self fileFormatError:'not an icns file (short read)'.
     ].
     id := id asString.
-    sizeRemaining := aStream nextUnsignedLongMSB:true.
+    sizeRemaining := aStream nextUnsignedInt32MSB:true.
     sizeRemaining := sizeRemaining - 4 - 4. "/ file magic and size are included in count
 
     (id ~= 'icns') ifTrue:[
@@ -133,7 +131,7 @@
         ].
         chunkType := chunkType asString.
 
-        numChunkBytes := aStream nextUnsignedLongMSB:true.
+        numChunkBytes := aStream nextUnsignedInt32MSB:true.
         numChunkBytes := numChunkBytes - 4 - 4. "/ type and size are included in count
 
         chunkData := aStream next:numChunkBytes.
@@ -237,14 +235,14 @@
                     at:eachImage width ifAbsent:[self error]. 
         tempStream
             nextPutBytes:typeCode;
-            nextPutLong:(data size + 4 + 4) MSB:true;
+            nextPutInt32:(data size + 4 + 4) MSB:true;
             nextPutAll:data.
     ].
 
     aStream 
         binary;
         nextPutBytes:'icns';
-        nextPutLong:(tempStream position + 4 + 4) MSB:true;
+        nextPutInt32:(tempStream position + 4 + 4) MSB:true;
         nextPutAll:(tempStream contents).
 
     "