Here you can find the source of toAsciiString(String value)
public static String toAsciiString(String value)
//package com.java2s; public class Main { public static String toAsciiString(String value) { int i, j; int len = value.length(); if ((len % 2) != 0) { return value; }//from ww w . j a v a 2 s .c om try { byte[] byteValue = new byte[len / 2]; j = 0; for (i = 0; i < byteValue.length; i++) { byteValue[i] = Byte .parseByte(value.substring(j, j + 2), 16); j += 2; } return new String(byteValue, "US-ASCII"); } catch (Exception e) { return value; } } }