Here you can find the source of byteToString(int n)
public static String byteToString(int n)
//package com.java2s; // the terms and conditions of the Cryptix General Licence. You should have public class Main { private static final char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; /**//from w w w .j a v a 2s . c om * Returns a string of 2 hexadecimal digits (most significant digit first) * corresponding to the lowest 8 bits of <i>n</i>. */ public static String byteToString(int n) { char[] buf = { hexDigits[(n >>> 4) & 0x0F], hexDigits[n & 0x0F] }; return new String(buf); } }