/** * Tells whether the named charset is supported. </p> * * @param charsetName * The name of the requested charset; may be either * a canonical name or an alias * * @return <tt>true</tt> if, and only if, support for the named charset * is available in the current Java virtual machine * * @throws IllegalCharsetNameException * If the given charset name is illegal * * @throws IllegalArgumentException * If the given <tt>charsetName</tt> is null */ public static boolean isSupported(String charsetName) { return (lookup(charsetName) != null); }
/** * Tells whether the named charset is supported. </p> * * @param charsetName * The name of the requested charset; may be either * a canonical name or an alias * * @return <tt>true</tt> if, and only if, support for the named charset * is available in the current Java virtual machine * * @throws IllegalCharsetNameException * If the given charset name is illegal * * @throws IllegalArgumentException * If the given <tt>charsetName</tt> is null */ public static boolean isSupported(String charsetName) { return (lookup(charsetName) != null); }
/** * Returns a charset object for the named charset. </p> * * @param charsetName * The name of the requested charset; may be either * a canonical name or an alias * * @return A charset object for the named charset * * @throws IllegalCharsetNameException * If the given charset name is illegal * * @throws IllegalArgumentException * If the given <tt>charsetName</tt> is null * * @throws UnsupportedCharsetException * If no support for the named charset is available * in this instance of the Java virtual machine */ public static Charset forName(String charsetName) { Charset cs = lookup(charsetName); if (cs != null) return cs; throw new UnsupportedCharsetException(charsetName); }
/** * Returns a charset object for the named charset. </p> * * @param charsetName * The name of the requested charset; may be either * a canonical name or an alias * * @return A charset object for the named charset * * @throws IllegalCharsetNameException * If the given charset name is illegal * * @throws IllegalArgumentException * If the given <tt>charsetName</tt> is null * * @throws UnsupportedCharsetException * If no support for the named charset is available * in this instance of the Java virtual machine */ public static Charset forName(String charsetName) { Charset cs = lookup(charsetName); if (cs != null) return cs; throw new UnsupportedCharsetException(charsetName); }