Here you can find the source of convertCharToByte(char[] from)
static public byte[] convertCharToByte(char[] from)
//package com.java2s; public class Main { static public byte[] convertCharToByte(char[] from) { int size = from.length; byte[] to = new byte[size]; for (int i = 0; i < size; i++) to[i] = (byte) from[i]; // LOOK wrong, convert back to unsigned byte ??? return to; }/*from ww w . j a v a2 s . c o m*/ }