What is the best way to read and write C-styled byte stuctures in Scala, like this:
struct account {
int id;
char[10] data1;
char[10] data2;
float dataFloat;
};
There's unpack function in Python, to interpret strings as packed binary data. But I can't find any analogue in Scala.
What is standart way for such a mapping in Scala? Read bytes one by one is very unsufficiant. The protocol I need to parse comes back fromk 1980s and contains different fields (short, int, float) so read it byte-by-byte will be very unsufficient.