title: String to byte array conversion varies from windows and ubuntu
body: <pre><code>public static void main(String args[])
      {       
          byte[] bytearray = new byte[]{1, -30, 48, 50, 49, 48};
  
          for (int i = 0; i &lt; bytearray.length; i++) {
              System.out.print(bytearray[i]+", ");
          }
          System.out.println();
          System.out.println("Length of byteArray before : "+bytearray.length);
  
          String st = new String(bytearray);
          System.out.println("String value : "+ st);  
  
          bytearray = st.getBytes();
  
          for (int i = 0; i &lt; bytearray.length; i++) {
              System.out.print(bytearray[i]+", ");
          }
          System.out.println();
          System.out.println("Length of byteArray after : "+bytearray.length);
      }
  </code></pre>
  
  <p>this is my program if i am executing this on windows i am getting exactly same bytes as previous but on ubuntu, it's giving extra 2 bytes I didn't understand it ? why ?</p>
  
  <p>which method should I use to get same array on ubuntu ?</p>