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);
    }
  }
public static String encodeString(OneWayCodec codec, String s)
  {
    try
    {
      return codec.encode(s.getBytes("UTF-8"));
    }
    catch(UnsupportedEncodingException ex)
    {
      
      throw new RuntimeException(ex);
    }
  }
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.

@param codec encode the string
@param s the string to encode
@return the encoded string
Encodes the string using the codec provided .