title: How do I convert Long to byte[] and back in java
body: <p>How do I convert a <code>long</code> to a <code>byte[]</code> and back in Java?</p>
  
  <p>I'm trying convert a <code>long</code> to a <code>byte[]</code> so that I will be able to send the <code>byte[]</code> over a TCP connection. On the other side I want to take that <code>byte[]</code> and convert it back into a <code>double</code>.</p>