static String byteAsChar ( byte v ) { int chr = v & 0xff ; return String . format ( Locale . ROOT , "%s (0x%02x)" , ( Character . isWhitespace ( chr ) || chr > 127 ) ? "[non-printable]" : Character . toString ( ( char ) chr ) , v & 0xFF ) ; }
Convert a byte to an informative string .