public static String encodeString ( OneWayCodec codec , String s ) { try { return codec . encode ( s . getBytes ( "UTF-8" ) ) ; } catch ( UnsupportedEncodingException ex ) { // shouldn't happen throw new RuntimeException ( ex ) ; } }
Encodes the string using the codec provided .