[Gambas-user] Endianness issue with Streams ?

Laurent Carlier lordheavym at gmail.com
Wed Feb 7 13:59:13 CET 2024


While reading data from a file using Read function and changing endianness i 
found a somehow strange behavior.

----8<-----

  Dim $iValue As Integer
  Dim oFitFile As File

  oFitFile = Open "toto" For Read
  $iValue = Read #oFitFile As Short
  Print Hex$($iValue), $iValue
---->8-----

Setting ByteOrder as Little endian gives:
5E9     1513
Setting ByteOrder as Big endian gives:
FFFFFFFFFFFFE905        -5883


So is it expected or is it a bug ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240207/2d138faa/attachment.sig>


More information about the User mailing list