I need something similar to Python’s struct module for a Java project. I would like to pack integer (and perhaps floats and doubles as well) into byte arrays. Furthermore, I want to choose the endianness and generally have full control over how this is done because I need to send this data to some hardware which will be running code in another language.
Share
From here: Convert 4 bytes to int, you can use java.nio.ByteBuffer