[Cuis-dev] [DEFECT] Can neither write nor read DoubleByteArray instances

Gerald Klix cuis.01 at klix.ch
Sun Jul 30 06:04:30 PDT 2023


Hi all, Hi Juan,

I just found out that I can neither write nor read
instances of a DoubleByteArray with the new UniFileStream.

The writing issue can be fixed easily by adding:

asUtf8Bytes
	"Answer me as UTF8 bytes for writing on a UniFileStream."
	
	^ self

to DoubleByteArray.

Reading a whole junk into a double byte array
fails completely, because the #next:into:startingAt:
tries to do this byte by byte (and fails).


Test code:

'test.bytes' asFileEntry forceWriteStreamDo: [ :stream |
	stream nextPutAll: (DoubleByteArray with: 4711) ].

'test.bytes' asFileEntry readStreamDo: [ :stream | | a |
	a := DoubleByteArray new: 1.
	a byteSize print.
	stream next: a byteSize into: a startingAt: 1.
	a explore ]


Best Regards,

Gerald


PS: Needless to sya that DoubleWordArray has the same problems.


More information about the Cuis-dev mailing list