Added a function to generate bytes for 16 bit integers.