I need to convert byte[] to char[] in Java. The Unicode encoding used is UTF-16.
To be concise, I need a Java equivalent of c#'s
UnicodeEncoding.Unicode.GetChars(byte[] bytes);
Also, I need to convert only a part of byte[] to char[]
public virtual char[] GetChars(byte[] bytes, int index, int count);
You can try this:
From
String(byte[] bytes, String charsetName)
: