Android examples for java.lang:Character
Create a char array from a byte array
public class Main{ /**/*from www. ja va2 s.c om*/ * Create a char array from a byte array * * @param bytes * the byte array * @return a char array */ public static char[] byteArrayToCharArray(byte[] bytes) { char[] result = new char[bytes.length]; for (int i = 0; i < bytes.length; i++) { result[i] = (char) bytes[i]; } return result; } }