In PLC4X we have the same issues ... This is the tiny helper we use to detect the endianess of the system we're running on.
https://github.com/apache/plc4x/blob/develop/plc4c/spi/src/system.c#L61 Chris -----Ursprüngliche Nachricht----- Von: Jamber Zhang <[email protected]> Gesendet: Montag, 27. September 2021 04:07 An: [email protected] Betreff: Re: Endianess. So, If we write C/C++ codes for this part, we may firstly check local CPU Endian before sensitive coding.. Best ----------------------- Jamber Jamber Zhang <[email protected]> 于2021年9月27日周一 上午10:01写道: > Hi, > Normally, in Java's default configuration, ByteBuffer is BigEndian. > Network protocol often use BigEndian. > For C/C++, the endian depends on CPU type. X86 CPU use LittleEndian. > > Best > ----------------------- > Jamber > > Yuan Tian <[email protected]> 于2021年9月27日周一 上午9:50写道: > >> Hi, >> I remember that the default endian in C++ seems to be LittleEndian. >> >> Best, >> ------------------- >> Yuan Tian >> >> On Mon, Sep 27, 2021 at 2:26 AM Giorgio Zoppi >> <[email protected]> >> wrote: >> >> > Hello IoTDBers, >> > on disk, the java writes in BigEndian the buffer right? >> > I am looking at parquet, especially the implementation in C++, >> > there are similarities. Why did you choose your own? >> > BR, >> > Giorgio. >> > >> >
