Alexander’s answer explains why it’s there, but not how to get rid of it. You simply need to specify the endianness you want in the encoding name:
String source = "0123456789";
byte[] byteArray = source.getBytes("UTF-16LE"); // Or UTF-16BE
Alexander’s answer explains why it’s there, but not how to get rid of it. You simply need to specify the endianness you want in the encoding name:
String source = "0123456789";
byte[] byteArray = source.getBytes("UTF-16LE"); // Or UTF-16BE