Easy accessible in a NEWP, Mesa, PL/I, Modula-2 or Ada manual, on how to map structs into byte arrays.
Or for something more modern either D or C++ will do.
Examples omitted on request.