class Charsets
extends java.lang.Object
Provides utilities for Charset
.
Package private since Apache Commons IO already provides a Charsets because Charset
is in
java.nio.charset
.
Constructor and Description |
---|
Charsets() |
Modifier and Type | Method and Description |
---|---|
(package private) static java.nio.charset.Charset |
toCharset(java.nio.charset.Charset charset)
Returns the given
charset or the default Charset if charset is null. |
(package private) static java.nio.charset.Charset |
toCharset(java.lang.String charsetName)
Returns the given
charset or the default Charset if charset is null. |
(package private) static java.lang.String |
toCharsetName(java.lang.String charsetName)
Returns the given
charset or the default Charset if charset is null. |
static java.nio.charset.Charset toCharset(java.nio.charset.Charset charset)
charset
or the default Charset if charset
is null.charset
- a Charset or null.charset
or the default Charset if charset
is null.static java.nio.charset.Charset toCharset(java.lang.String charsetName)
charset
or the default Charset if charset
is null.charsetName
- a Charset or null.charset
or the default Charset if charset
is null.java.nio.charset.UnsupportedCharsetException
- If no support for the named charset is available in this instance of the Java
virtual machinestatic java.lang.String toCharsetName(java.lang.String charsetName)
charset
or the default Charset if charset
is null.charsetName
- a Charset or null.charset
or the default Charset if charset
is null.