This is what I could come up with:
int=65534
printf "0: %.8x" $int | xxd -r -g0 >>file
Now depending on endianness you might want to swap the byte order:
printf "0: %.8x" $int | sed -E 's/0: (..)(..)(..)(..)/0: \4\3\2\1/' | xxd -r -g0 >>file
Example (decoded, so it's visible):
printf "0: %.8x" 65534 | sed -E 's/0: (..)(..)(..)(..)/0: \4\3\2\1/' | xxd -r -g0 | xxd
0000000: feff 0000 ....
This is for unsigned int, if the int is signed and the value is negative you have to compute the two's complement. Simple math.