Writes value as a little-endian int into buffer at the current offset.
If there isn’t enough room, flush is called.
the new offset (currentOffset + 4)