code: public Charset setCharset(Charset charset) {
          Charset prev = this.charset.get();
          this.charset.set(charset);
          return prev;
      }
docs: Set the charset to use
  @param charset new charset
  @return previous charset