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

# Class Utf8Encoder

java.lang.Object
java.nio.charset.CharsetEncoder
org.apache.tomcat.util.buf.Utf8Encoder

public class Utf8Encoder extends CharsetEncoder
Encodes characters as bytes using UTF-8. Extracted from Apache Harmony with some minor bug fixes applied.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Utf8Encoder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected CoderResult`
  `encodeLoop(CharBuffer in, ByteBuffer out)`

  ### Methods inherited from class CharsetEncoder

  `averageBytesPerChar, canEncode, canEncode, charset, encode, encode, flush, implFlush, implOnMalformedInput, implOnUnmappableCharacter, implReplaceWith, implReset, isLegalReplacement, malformedInputAction, maxBytesPerChar, onMalformedInput, onUnmappableCharacter, replacement, replaceWith, reset, unmappableCharacterAction`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### Utf8Encoder

    public Utf8Encoder()

- ## Method Details

  - ### encodeLoop

    protected CoderResult encodeLoop(CharBuffer in, ByteBuffer out)
    Specified by:
      `encodeLoop` in class `CharsetEncoder`