#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.
--- 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).
"