code: public void setCharsetName(final String charsetName) {
          if(Charset.isSupported(charsetName)) {
              this.charsetName = charsetName;
          }
          else {
              throw new UnsupportedCharsetException("No support for, " + charsetName + ", is available in this instance of the JVM");
          }
      }
docs: Setter for property charsetName.
  
  @param charsetName The name of the requested charset; may be either a canonical name or an alias
  @throws java.lang.IllegalArgumentException If <tt>charsetName</tt> is null
  @throws java.nio.charset.IllegalCharsetNameException If the given charset name is illegal
  @throws java.nio.charset.UnsupportedCharsetException If no support for the named charset is available in this
  instance of the Java virtual machine