Package org.apache.commons.lang3
Class Charsets
java.lang.Object
org.apache.commons.lang3.Charsets
Internal use only.
Provides utilities for Charset
.
Package private since Apache Commons IO already provides a Charsets because Charset
is in
java.nio.charset
.
- Since:
- 3.10
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static Charset
Returns the givencharset
or the default Charset ifcharset
is null.(package private) static Charset
Returns the givencharset
or the default Charset ifcharset
is null.(package private) static String
toCharsetName
(String charsetName) Returns the givencharset
or the default Charset ifcharset
is null.
-
Constructor Details
-
Charsets
Charsets()
-
-
Method Details
-
toCharset
Returns the givencharset
or the default Charset ifcharset
is null.- Parameters:
charset
- a Charset or null.- Returns:
- the given
charset
or the default Charset ifcharset
is null.
-
toCharset
Returns the givencharset
or the default Charset ifcharset
is null.- Parameters:
charsetName
- a Charset or null.- Returns:
- the given
charset
or the default Charset ifcharset
is null. - Throws:
UnsupportedCharsetException
- If no support for the named charset is available in this instance of the Java virtual machine
-
toCharsetName
Returns the givencharset
or the default Charset ifcharset
is null.- Parameters:
charsetName
- a Charset or null.- Returns:
- the given
charset
or the default Charset ifcharset
is null.
-