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

Gerald Klix cuis.01 at klix.ch
Sun Jul 30 07:18:19 PDT 2023


I just started to back-port the old StandardFileStream class,
removing all of its character support and renaming it to
BinaryFileStream.

Hope That Works,

Gerald



On 7/30/23 3:04 PM, Gerald Klix via Cuis-dev wrote:
> 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