title: Method string to byte
body: <p>I spend all the day trying to find the answer, so finally I write here.
  I encrypt one string with class crypto and I get a byte[].
  I have to convert this byte in string with tostring(), to upload in one web.
  I need to get this string, decrypts and get the original string.
  My problem is about getBytes, that not return the same byte[] to decrypt.</p>
  
  <p>I need convert the original string to byte[], encrypt, get the byte[] that returns, convert to string and then, this string convert to byte[] and get the same byte[] encrypted.</p>
  
  <p>I try all that it was in my mind.
  I need some method that with one string, returns always the same byte[] and getbytes don't make this.</p>
  
  <p>I add one example:</p>
  
  <pre><code>      String s2="this is an example";
        byte[] b1=s2.getBytes("UTF-8");
        byte[] b2=s2.getBytes("UTF-8");
        System.out.println("Byte s:"+b1);
        System.out.println("Byte s:"+b2);
  </code></pre>
  
  <p>There is one method that from one string give the same byte[]?
  With getBytes (at least at me) I obtain two different byte[].
  Thanks.</p>