readValue

fnT readValue(T)(const(ubyte)[] data, size_t offset, ElfEndian fileEndian) if (isIntegral!T)

Read a value from a byte array at a specified offset.

This template function reads an integral value from a byte array, handling endianness conversion as needed.

Parameters

dataThe byte array to read from.
offsetThe offset in bytes to start reading from.
fileEndianThe endianness of the data.

Returns

The read value converted to native endianness.

Throws

Exception if offset is out of bounds or not enough data to read.