title: Equivalent GetBytes function in Java like c#
body: <p>I have problem with converting string to bytes in Java when I'm porting my C# library to it. It converts the string but it is not the same byte array.</p>
  
  <p>I use this code in C#</p>
  
  <pre><code>string input = "Test ěščřžýáíé 1234";
  Encoding encoding = Encoding.UTF8;
  byte[] data = encoding.GetBytes(input);
  </code></pre>
  
  <p>And code in Java</p>
  
  <pre><code>String input = "Test ěščřžýáíé 1234";
  String encoding = "UTF8";
  byte[] data = input.getBytes(encoding);
  </code></pre>
  
  <p>Lwft one is Java output and right one is C# how to make Java output same as C# one ?</p>
  
  <p><img src="https://i.stack.imgur.com/V9XE8.png" alt="enter image description here"></p>