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`.
  Since:
    2.12.0

- - ### 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, 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.
      Parameters:
        `charsetEncoder` - The CharsetEncoder to test.
      Returns:
        the given non-null CharsetEncoder or a new default CharsetEncoder.

    - #### toCharsetEncoder

          public static CharsetEncoder toCharsetEncoder(CharsetEncoder charsetEncoder,
                                                        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.
      Since:
        2.13.0

Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.