protected String encodedByte ( int b ) { String hex = Integer . toHexString ( b ) . toUpperCase ( ) ; if ( hex . length ( ) < 2 ) { return "%0" + hex ; } else { return "%" + hex ; } }
Perform % - encoding on a single byte .