Code example for Charset

Methods: name

  protected Charset charset = Charset.forName("UTF-8");
  /** @deprecated This field is no longer used. Use {@link #charset} instead. */ 
  protected String charsetName =;
  public IdentityEncoder() { 
  public IdentityEncoder(Charset charset) {
    this.charset = charset;
    // @deprecated, remove this in 4.0: 
    charsetName =;
  public Payload encode(char[] buffer, int offset, int length) {
    final ByteBuffer bb = charset.encode(CharBuffer.wrap(buffer, offset, length));
    if (bb.hasArray()) {
Connect your IDE to all the code out there  Get Codota for Java