org.linkedin.util-core/src/main/java/org/linkedin/util/codec/CodecUtils.java
public static String decodeString(Codec codec, String s)
    throws Codec.CannotDecodeException
  {
    try
    {
      return new String(codec.decode(s), "UTF-8");
    }
    catch(UnsupportedEncodingException ex)
    {
      // shouldn't happen
      throw new RuntimeException(ex);
    }
  }
public static String decodeString(Codec codec, String s)
    throws Codec.CannotDecodeException
  {
    try
    {
      return new String(codec.decode(s), "UTF-8");
    }
    catch(UnsupportedEncodingException ex)
    {
      // shouldn't happen
      throw new RuntimeException(ex);
    }
  }
Decodes the string using the codec provided. Returns a string

@param codec encode the string
@param s the string to encode
@return the encoded string
@throws Codec.CannotDecodeException if cannot decode the string