public final class CharsetUtil
extends java.lang.Object
Charset
and its relevant classes.限定符和类型 | 字段和说明 |
---|---|
static java.nio.charset.Charset |
ISO_8859_1
ISO Latin Alphabet No. 1, as known as ISO-LATIN-1
|
static java.nio.charset.Charset |
US_ASCII
7-bit ASCII, as known as ISO646-US or the Basic Latin block of the
Unicode character set
|
static java.nio.charset.Charset |
UTF_16
16-bit UTF (UCS Transformation Format) whose byte order is identified by
an optional byte-order mark
|
static java.nio.charset.Charset |
UTF_16BE
16-bit UTF (UCS Transformation Format) whose byte order is big-endian
|
static java.nio.charset.Charset |
UTF_16LE
16-bit UTF (UCS Transformation Format) whose byte order is little-endian
|
static java.nio.charset.Charset |
UTF_8
8-bit UTF (UCS Transformation Format)
|
限定符和类型 | 方法和说明 |
---|---|
static java.nio.charset.CharsetDecoder |
decoder(java.nio.charset.Charset charset)
Returns a cached thread-local
CharsetDecoder for the specified Charset . |
static java.nio.charset.CharsetDecoder |
decoder(java.nio.charset.Charset charset,
java.nio.charset.CodingErrorAction codingErrorAction)
Returns a new
CharsetDecoder for the Charset with the specified error action. |
static java.nio.charset.CharsetDecoder |
decoder(java.nio.charset.Charset charset,
java.nio.charset.CodingErrorAction malformedInputAction,
java.nio.charset.CodingErrorAction unmappableCharacterAction)
Returns a new
CharsetDecoder for the Charset with specified error actions. |
static java.nio.charset.CharsetEncoder |
encoder(java.nio.charset.Charset charset)
Returns a cached thread-local
CharsetEncoder for the specified Charset . |
static java.nio.charset.CharsetEncoder |
encoder(java.nio.charset.Charset charset,
java.nio.charset.CodingErrorAction codingErrorAction)
Returns a new
CharsetEncoder for the Charset with the specified error action. |
static java.nio.charset.CharsetEncoder |
encoder(java.nio.charset.Charset charset,
java.nio.charset.CodingErrorAction malformedInputAction,
java.nio.charset.CodingErrorAction unmappableCharacterAction)
Returns a new
CharsetEncoder for the Charset with specified error actions. |
static java.nio.charset.CharsetDecoder |
getDecoder(java.nio.charset.Charset charset)
已过时。
Use
decoder(Charset) . |
static java.nio.charset.CharsetEncoder |
getEncoder(java.nio.charset.Charset charset)
已过时。
Use
encoder(Charset) . |
static java.nio.charset.Charset[] |
values() |
public static final java.nio.charset.Charset UTF_16
public static final java.nio.charset.Charset UTF_16BE
public static final java.nio.charset.Charset UTF_16LE
public static final java.nio.charset.Charset UTF_8
public static final java.nio.charset.Charset ISO_8859_1
public static final java.nio.charset.Charset US_ASCII
public static java.nio.charset.Charset[] values()
@Deprecated public static java.nio.charset.CharsetEncoder getEncoder(java.nio.charset.Charset charset)
encoder(Charset)
.public static java.nio.charset.CharsetEncoder encoder(java.nio.charset.Charset charset, java.nio.charset.CodingErrorAction malformedInputAction, java.nio.charset.CodingErrorAction unmappableCharacterAction)
CharsetEncoder
for the Charset
with specified error actions.charset
- The specified charsetmalformedInputAction
- The encoder's action for malformed-input errorsunmappableCharacterAction
- The encoder's action for unmappable-character errorscharset
public static java.nio.charset.CharsetEncoder encoder(java.nio.charset.Charset charset, java.nio.charset.CodingErrorAction codingErrorAction)
CharsetEncoder
for the Charset
with the specified error action.charset
- The specified charsetcodingErrorAction
- The encoder's action for malformed-input and unmappable-character errorscharset
public static java.nio.charset.CharsetEncoder encoder(java.nio.charset.Charset charset)
CharsetEncoder
for the specified Charset
.charset
- The specified charsetcharset
@Deprecated public static java.nio.charset.CharsetDecoder getDecoder(java.nio.charset.Charset charset)
decoder(Charset)
.public static java.nio.charset.CharsetDecoder decoder(java.nio.charset.Charset charset, java.nio.charset.CodingErrorAction malformedInputAction, java.nio.charset.CodingErrorAction unmappableCharacterAction)
CharsetDecoder
for the Charset
with specified error actions.charset
- The specified charsetmalformedInputAction
- The decoder's action for malformed-input errorsunmappableCharacterAction
- The decoder's action for unmappable-character errorscharset
public static java.nio.charset.CharsetDecoder decoder(java.nio.charset.Charset charset, java.nio.charset.CodingErrorAction codingErrorAction)
CharsetDecoder
for the Charset
with the specified error action.charset
- The specified charsetcodingErrorAction
- The decoder's action for malformed-input and unmappable-character errorscharset
public static java.nio.charset.CharsetDecoder decoder(java.nio.charset.Charset charset)
CharsetDecoder
for the specified Charset
.charset
- The specified charsetcharset