title: Convert long to byte array and add it to another array
body: <p>I want to change a values in byte array to put a long timestamp value in in the MSBs. Can someone tell me whats the best way to do it. I do not want to insert values bit-by-bit which I believe is very inefficient. </p>
  
  <pre><code>long time = System.currentTimeMillis();
  Long timeStamp = new Long(time);
  byte[] bArray = new byte[128];
  </code></pre>
  
  <p>What I want is something like:</p>
  
  <pre><code>byte[0-63] = timeStamp.byteValue(); 
  </code></pre>
  
  <p>Is something like this possible . What is the best way to edit/insert values in this byte array. since byte is a primitive I dont think there are some direct implementations I can make use of?</p>
  
  <p>Edit:<br>
  It seems that <code>System.currentTimeMillis()</code> is faster than <code>Calendar.getTimeInMillis()</code>, so replacing the above code by it.Please correct me if wrong.</p>