title: Convert an integer to BYTE value
body: <p>I'm trying to write some command to serial comm port. Say I need to send 10 bytes of data to comm port. Now out of that 10 bytes, data message is something like:</p>
  
  <pre><code>Byte offset 0    - message id
  Byte offset 1-4  - unix time in format 1432419028
  Byte offset 5-10 - data
  </code></pre>
  
  <p>My query is how do I convert unix time 1432419028 to fit in my BYTE array. 
  Platform is C++ Visual Studio. </p>
  
  <p>I got some sample to write like</p>
  
  <pre><code>  BYTE initmsg[10];
    unsigned int* UNALIGNED epoch_time = (unsigned int*) &amp;initmsg[1];
    *epoch_time = 12345678;
  </code></pre>
  
  <p>But I would like to construct the initmsg look like below.</p>
  
  <pre><code>  initmsg[1] = 0x01;
    initmsg[2] = 0x01;
    initmsg[3] = 0x01;
    initmsg[4] = 0x01;
  </code></pre>