code: 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);
      }
    }
docs: Encodes the string using the codec provided.
  
  @param codec encode the string
  @param s the string to encode
  @return the encoded string