H5T_SET_OFFSET sets the bit offset of the first significant bit. The significant bits of an atomic datum can be offset from the beginning of the memory for that datum by an amount of padding. The
offset property specifies the number of bits of padding that appear “to the right of” the value. That is, if we have a 32-bit datum with 16-bits of precision having the value
0x1122, then it will be laid out in memory as (from small byte address toward larger byte addresses):
|Byte Position||Big-Endian Offset=0||Big-Endian Offset=16||Little-Endian Offset=0||Little-Endian Offset=16|
|0||[ pad]||[0x11]||[0x22]||[ pad]|
|1||[ pad]||[0x22]||[0x11]||[ pad]|
|2||[0x11]||[ pad]||[ pad]||[0x22]|
|3||[0x22]||[ pad]||[ pad]||[0x11]|
If the offset is incremented then the total size is incremented also if necessary to prevent significant bits of the value from hanging over the edge of the datatype.
The offset of an H5T_STRING cannot be set to anything but zero.