title: How to Convert Data to Formatted Bytes?
body: <p>Does anyone have any suggestions on how to convert data (mostly strings) into their formatted byte representation? </p>
  
  <p>For example, if I enter the string "01" I'd like to get <code>00 01</code> or if I enter "0001" I'd like to get <code>00 00 00 01</code></p>
  
  <p>I've tried using ByteBuffer but the output is always 8 bits long, i.e. <code>01 =&gt; 00 00 00 01</code></p>