Here you can find the source of getBytesASCII(String s)
public static byte[] getBytesASCII(String s)
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; public class Main { public static byte[] getBytesASCII(String s) { try {//from w ww. j ava2s . co m return s.getBytes("ASCII"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); // cannot happen } } }