public static String toChar(byte b){
  if (b >= 0x20) {
    return Character.toString((char)b);
  }
 else {
    return String.format("%02x",b);
  }
}

public static String toChar ( byte b ) { if ( b >= 0x20 ) { return Character . toString ( ( char ) b ) ; } else { return String . format ( "%02x" , b ) ; } }
convert a byte to a character for printing . if the byte value is & lt ; 32 - and hence unprintable - the byte is returned as a two digit hex value
