fn readIntForeign(comptime T: type, bytes: *const [@divExact(@typeInfo(T).Int.bits, 8)]u8) T

Reads an integer from memory with bit count specified by T. The bit count of T must be evenly divisible by 8. This function cannot fail and cannot cause undefined behavior. Assumes the endianness of memory is foreign, so it must byte-swap.

Parameters

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