C2BConverter (Apache Tomcat 10.1.48 API Documentation)
Description: declaration: package: org.apache.tomcat.util.buf, class: C2BConverter

# Class C2BConverter

java.lang.Object
org.apache.tomcat.util.buf.C2BConverter

public final class C2BConverter extends Object
NIO based character encoder.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `C2BConverter(Charset charset)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `convert(CharBuffer cc, ByteBuffer bc)`
  Convert the given characters to bytes.
  `void`
  `convert(CharChunk cc, ByteChunk bc)`
  Convert the given characters to bytes.
  `Charset`
  `getCharset()`
  `boolean`
  `isUndeflow()`
  `boolean`
  `isUnderflow()`
  `void`
  `recycle()`
  Reset the encoder state.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### C2BConverter

    public C2BConverter(Charset charset)

- ## Method Details

  - ### recycle

    public void recycle()
    Reset the encoder state.

  - ### isUnderflow

    public boolean isUnderflow()

  - ### isUndeflow

    public boolean isUndeflow()

  - ### convert

    public void convert(CharChunk cc, ByteChunk bc) throws IOException
    Convert the given characters to bytes.
    Parameters:
      `cc` - char input
      `bc` - byte output
    Throws:
      `IOException` - An encoding error occurred

  - ### convert

    public void convert(CharBuffer cc, ByteBuffer bc) throws IOException
    Convert the given characters to bytes.
    Parameters:
      `cc` - char input
      `bc` - byte output
    Throws:
      `IOException` - An encoding error occurred

  - ### getCharset

    public Charset getCharset()