D dilettante Active Member Licensed User Longtime User Dec 28, 2013 #1 The docs say: Gets or sets the endian-ness of byte conversions to and from other primitive values. The default for Android is Big_Endian, Windows PCs are Little_Endian. Click to expand... However: In B4J (Windows x86) the value returns false by default and it should be true. The Android default should depend on the platform (ARM vs. x86), if it doesn't already. I assume that if you could ever get a B4J program installed to run on an ARM-based Win8 machine then it would also need to default to false. If you ran a B4J program on Linux-on-ARM (far from rare now) it would need to default to false. By "need to" I mean it is often necessary to be able to determine what platform endianness you have at runtime in order to do proper mapping between host byte order and network byte order for a vast number of Internet protocols. Frankly we might be better off if the Socket library provided methods such as htonl(), ntohl(), and friends as one would normally expect. But perhaps I am missing something here, either the intent of this Property or my attempted usage of it.
The docs say: Gets or sets the endian-ness of byte conversions to and from other primitive values. The default for Android is Big_Endian, Windows PCs are Little_Endian. Click to expand... However: In B4J (Windows x86) the value returns false by default and it should be true. The Android default should depend on the platform (ARM vs. x86), if it doesn't already. I assume that if you could ever get a B4J program installed to run on an ARM-based Win8 machine then it would also need to default to false. If you ran a B4J program on Linux-on-ARM (far from rare now) it would need to default to false. By "need to" I mean it is often necessary to be able to determine what platform endianness you have at runtime in order to do proper mapping between host byte order and network byte order for a vast number of Internet protocols. Frankly we might be better off if the Socket library provided methods such as htonl(), ntohl(), and friends as one would normally expect. But perhaps I am missing something here, either the intent of this Property or my attempted usage of it.
D dilettante Active Member Licensed User Longtime User Dec 28, 2013 #2 The version of ByteConverter that I have reports its version as 1.1, not 1.10 as stated in the docs. However I realize that it reports this as a Double which can lead to a lot of confusion. Maybe I should assume that the "1.1" release (if any) reported 1.01?
The version of ByteConverter that I have reports its version as 1.1, not 1.10 as stated in the docs. However I realize that it reports this as a Double which can lead to a lot of confusion. Maybe I should assume that the "1.1" release (if any) reported 1.01?
Erel B4X founder Staff member Licensed User Longtime User Dec 29, 2013 #3 The library version is displayed in the libraries tab and it is v1.10. I think that it is better that this library uses big-endian by default (the standard network endianess). This is the default endianess in the JVM. It doesn't really matter what the default encoding of the platform.
The library version is displayed in the libraries tab and it is v1.10. I think that it is better that this library uses big-endian by default (the standard network endianess). This is the default endianess in the JVM. It doesn't really matter what the default encoding of the platform.
D dilettante Active Member Licensed User Longtime User Dec 29, 2013 #4 You are right of course. Ensuring network byte order when implementing Internet protocols and binary data formats would be the main uses. I was thinking about it incorrectly, imagining a need to flip back and forth between endianness settings to convert to/from network byte order. Since the operation is symmetric you just let the library deal with the local platform's actual multibyte number ordering.
You are right of course. Ensuring network byte order when implementing Internet protocols and binary data formats would be the main uses. I was thinking about it incorrectly, imagining a need to flip back and forth between endianness settings to convert to/from network byte order. Since the operation is symmetric you just let the library deal with the local platform's actual multibyte number ordering.