Here you can find the source of asciiBytes(String x)
public static byte[] asciiBytes(String x)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] asciiBytes(String x) { byte[] res = new byte[x.length()]; for (int len = x.length(), i = 0; i < len; ++i) res[i] = (byte) x.charAt(i); return res; }//from w w w .j a v a2 s .c o m }