Here you can find the source of toAscii(byte[] ba)
public static String toAscii(byte[] ba)
//package com.java2s; //License from project: Open Source License public class Main { public static String toAscii(byte[] ba) { StringBuilder sb = new StringBuilder(); for (byte b : ba) { sb.append(Integer.toHexString(0xff & b)); }/*from w ww . j a v a 2s . c o m*/ return sb.toString(); } }