Package org.apache.commons.io.charset
Class CharsetEncoders
java.lang.Object
org.apache.commons.io.charset.CharsetEncoders
Works with
CharsetEncoder
.- Since:
- 2.12.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Method Details
-
toCharsetEncoder
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
-