Here you can find the source of toCharArray(byte[] barr)
public static char[] toCharArray(byte[] barr)
//package com.java2s; //License from project: Open Source License public class Main { /**// w w w. java2 s.c o m * Converts byte array to char array. */ public static char[] toCharArray(byte[] barr) { if (barr == null) { return null; } char[] carr = new char[barr.length]; for (int i = 0; i < barr.length; i++) { carr[i] = (char) barr[i]; } return carr; } }