public class Charsets
extends java.lang.Object
构造器和说明 |
---|
Charsets() |
限定符和类型 | 方法和说明 |
---|---|
static java.nio.charset.Charset |
toCharset(java.lang.String charsetName)
Returns a charset object for the given charset name.
|
static java.nio.charset.Charset |
toCharset(java.lang.String charsetName,
java.lang.String defaultCharsetName)
Returns a charset object for the given charset name.
|
public static java.nio.charset.Charset toCharset(java.lang.String charsetName)
charsetName
- The name of the requested charset; may be a canonical name, an alias, or null. If null, return the
default charset.public static java.nio.charset.Charset toCharset(java.lang.String charsetName, java.lang.String defaultCharsetName)
charsetName
- The name of the requested charset; may be a canonical name, an alias, or null.
If null, return the default charset.defaultCharsetName
- the charset name to use if the requested charset is null