i need the same byte in Java
Encoding.Unicode.GetBytes("asd") //{97, 0, 115, 0, 100, 0} C#
"asd".getBytes() //{97, 115, 100} Java
You're calling getBytes
in Java without passing any charset, so it's using the default one. You want something like:
byte[] bytes = "asd".getBytes(StandardCharsets.UTF_16LE);
See more on this question at Stackoverflow