Here you can find the source of charToByte(char[] values)
public static byte[] charToByte(char[] values)
//package com.java2s; public class Main { public static byte[] charToByte(char[] values) { if (values == null) { return null; }/* w w w. java 2 s . com*/ byte[] results = new byte[values.length]; for (int i = 0; i < values.length; i++) { results[i] = (byte) values[i]; } return results; } }