[Cuis-dev] [DEFECT] Can neither write nor read DoubleByteArray instances
Gerald Klix
cuis.01 at klix.ch
Sun Jul 30 08:08:36 PDT 2023
This BinaryFileStream approach seems to work. Only to testcases failing.
On 7/30/23 4:18 PM, Gerald Klix via Cuis-dev wrote:
> 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