title: Convert char[] to byte[] without losing 'bits'
body: <p>I'm developing an Android 2.3.3 application with Java.</p>
  
  <p>This app is an iOS code with unsigned data types port to Java.</p>
  
  <p>On iOS it works with <code>UInt16</code> and <code>UInt8</code>. In one case instead using <code>byte[]</code> I'm using <code>char[]</code>.</p>
  
  <p>But know I have to send that <code>char[]</code> as a <code>byte[]</code> using a <a href="http://developer.android.com/reference/java/net/DatagramPacket.html" rel="nofollow">DatagramPacket</a>.</p>
  
  <p>If one element of char[] is 128, how can I do to insert into byte[] and the receiver gets 128. I don't know what happens if I do this:</p>
  
  <pre><code>char c = (char)128;
  byte b = (byte)c;
  </code></pre>
  
  <p>Which will be <code>b</code> value?<br/>
  128 = 10000000. b = -1 or b = 127?</p>
  
  <p>How can I convert <code>char[]</code> to <code>byte[]</code> without losing any <strong>bits</strong>?</p>