Here you can find the source of toCharArray(byte[] byteArray)
Parameter | Description |
---|---|
byteArray | byte[] |
public static char[] toCharArray(byte[] byteArray)
//package com.java2s; public class Main { /**//from w w w.ja va 2s . c om * A utility method to convert from bytes to chars * @param byteArray byte[] * @return char[] */ public static char[] toCharArray(byte[] byteArray) { if (byteArray == null) { return null; } char[] result = new char[byteArray.length]; for (int i = 0; i < byteArray.length; i++) { result[i] = (char) byteArray[i]; } return result; } }