fn writeIntForeign(comptime T: type, buf: *[@divExact(@typeInfo(T).Int.bits, 8)]u8, value: T) void

Writes an integer to memory, storing it in twos-complement. This function always succeeds, has defined behavior for all inputs, but the integer bit width must be divisible by 8. This function stores in foreign endian, which means it does a @byteSwap first.

Parameters

T: type,
buf: *[@divExact(@typeInfo(T).Int.bits, 8)]u8,
value: T,