writeStruct

fnubyte[] writeStruct(T)(T value, ElfEndian fileEndian)

Write a packed struct to a byte array.

This template function writes a packed struct to a new byte array. Since ELF structs are packed with align(1), this function performs a direct byte copy. Fields requiring endianness conversion should be set before calling this function.

Parameters

valueThe struct to write.
fileEndianThe endianness to use for the output (reserved for future use).

Returns

A byte array containing the struct.