title: Java: ByteArray to positive number and vice versa conversion
body: <p>I'm looking for a way, how to reversibly convert a byte[] of an arbitrary length to <strong>positive</strong> number (String representation in numbers).</p>
  
  <p><strong>BigInteger offers a solution:</strong></p>
  
  <pre><code>byte[] originalBytes = ...
  String string = new BigInteger(originalBytes).toString();
  ...
  byte[] decodedBytes = new BigInteger(string).toByteArray();
  </code></pre>
  
  <p>However, I'm not sure how to get gracefully rid of negative values (or where to store the sign) and keep the process reversible.</p>