org.apache.commons.io.charset

## Class CharsetEncoders

- java.lang.Object
- - org.apache.commons.io.charset.CharsetEncoders

-     public final class CharsetEncoders
      extends Object

  Works with `CharsetEncoder`.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CharsetEncoder` | `toCharsetEncoder(CharsetEncoder charsetEncoder)` Returns the given non-null CharsetEncoder or a new default CharsetEncoder.
    `static CharsetEncoder` | `toCharsetEncoder(CharsetEncoder charsetEncoder, java.util.function.Supplier<CharsetEncoder> defaultSupplier)` Returns the given non-null CharsetEncoder or a new default CharsetEncoder.

    - ### Methods inherited from class java.lang.Object

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

- - ### Method Detail

    - #### toCharsetEncoder

          public static CharsetEncoder toCharsetEncoder(CharsetEncoder charsetEncoder)

      Returns the given non-null CharsetEncoder or a new default CharsetEncoder.

      Null input maps to the virtual machine's `default charset` decoder.

      Parameters:
        `charsetEncoder` - The CharsetEncoder to test.
      Returns:
        the given non-null CharsetEncoder or a new default CharsetEncoder.

    - #### toCharsetEncoder

          public static CharsetEncoder toCharsetEncoder(CharsetEncoder charsetEncoder,
                                                        java.util.function.Supplier<CharsetEncoder> defaultSupplier)

      Returns the given non-null CharsetEncoder or a new default CharsetEncoder.
      Parameters:
        `charsetEncoder` - The CharsetEncoder to test.
        `defaultSupplier` - The CharsetEncoder supplier to get when charsetEncoder is null.
      Returns:
        the given non-null CharsetEncoder or a new default CharsetEncoder.