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 Details

    • 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