title: Julia convert UInt32 to UInt8 vector
body: <p>I have the following code and I need to covert several UInt32 variables to UInt8 vectors so then combine them into a single UInt8 vector.</p>
  
  <p>The goal is to take the record I have decoded from a Pcap file and put it into a format that I can append to the end of an existing Pcap file.</p>
  
  <p>The code below takes output from a previous function and returns a hex output of 4 UInt 32's and a vector of UInt8's for the payload.</p>
  
  <pre><code>function pcap_get_record(s::PcapOffline)
  rec = PcapRec()
  if (!eof(s.file))
      rec.ts_sec   = s.is_big ? read(s.file, UInt32) : ntoh(read(s.file, UInt32))
      rec.ts_usec  = s.is_big ? read(s.file, UInt32) : ntoh(read(s.file, UInt32))
      rec.incl_len = s.is_big ? read(s.file, UInt32) : ntoh(read(s.file, UInt32))
      rec.orig_len = s.is_big ? read(s.file, UInt32) : ntoh(read(s.file, UInt32))
      rec.payload  = read(s.file, rec.incl_len)
      return rec
  end
  nothing
  end
  </code></pre>
  
  <p>Thanks</p>