Here you can find the source of asciiToString(byte ascii)
static String asciiToString(byte ascii)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { static String asciiToString(byte ascii) { switch (ascii) { case (int) '\n': return "\\n"; case (int) '\t': return "\\t"; case 11://from w w w.ja v a 2s. com return "\\v"; case 7: return "\\a"; case 8: return "\\b"; case 13: return "\\r"; case 12: return "\\f"; case (int) '\\': return "\\\\"; case (int) '\'': return "\\\'"; case (int) '\"': return "\\\""; case 0: return "\\0"; default: if (32 <= ascii && ascii <= 126) { // Printable ascii character. return (new Character((char) ascii)).toString(); } else { int high = (ascii & 0xF0) >>> 4; int low = ascii & 0xF; char highchar = (char) (high < 10 ? high + (int) '0' : high - 10 + (int) 'A'); char lowchar = (char) (low < 10 ? low + (int) '0' : low - 10 + (int) 'A'); char[] temp = { '\\', 'x', highchar, lowchar }; return new String(temp); } } } }