Hello Squeakers,
I have an algorithm for reading doom wads working in Pharo that I would
like to convert to Squeak, however, I cant for the life of me figure out
how to interpret a byte array of 4 bytes as an Unsigned Int. I see that a
ByteArray IS an UnsignedIntCollection, but cant seem to figure out how to
use it as such.
Functional Pharo:
binaryStream := wad binaryReadStream.
wadType := (binaryStream next: 4) asString.
numberOfDirectories := (binaryStream next: 4) uint32AtOffset: 0.
byteOffsetToDirectories := (binaryStream next: 4) uint32AtOffset: 0.
Semi Functional Squeak:
binaryStream := (FileStream readOnlyFileNamed: aFileLocation) binary
yourself .
wadType := (binaryStream next: 4) asString.
numberOfDirectories :=(binaryStream next: 4). ?
byteOffsetToDirectories := (binaryStream next: 4). ?
Thanks for your assistance!
Kind Regards,
Cody