Package org.apache.commons.lang3
Class Charsets
- java.lang.Object
-
- org.apache.commons.lang3.Charsets
-
class Charsets extends java.lang.ObjectInternal use only.Provides utilities for
Charset.Package private since Apache Commons IO already provides a Charsets because
Charsetis injava.nio.charset.- Since:
- 3.10
-
-
Constructor Summary
Constructors Constructor Description Charsets()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static java.nio.charset.CharsettoCharset(java.lang.String charsetName)Returns the givencharsetor the default Charset ifcharsetis null.(package private) static java.nio.charset.CharsettoCharset(java.nio.charset.Charset charset)Returns the givencharsetor the default Charset ifcharsetis null.(package private) static java.lang.StringtoCharsetName(java.lang.String charsetName)Returns the givencharsetor the default Charset ifcharsetis null.
-
-
-
Method Detail
-
toCharset
static java.nio.charset.Charset toCharset(java.nio.charset.Charset charset)
Returns the givencharsetor the default Charset ifcharsetis null.- Parameters:
charset- a Charset or null.- Returns:
- the given
charsetor the default Charset ifcharsetis null.
-
toCharset
static java.nio.charset.Charset toCharset(java.lang.String charsetName)
Returns the givencharsetor the default Charset ifcharsetis null.- Parameters:
charsetName- a Charset or null.- Returns:
- the given
charsetor the default Charset ifcharsetis null. - Throws:
java.nio.charset.UnsupportedCharsetException- If no support for the named charset is available in this instance of the Java virtual machine
-
toCharsetName
static java.lang.String toCharsetName(java.lang.String charsetName)
Returns the givencharsetor the default Charset ifcharsetis null.- Parameters:
charsetName- a Charset or null.- Returns:
- the given
charsetor the default Charset ifcharsetis null.
-
-