public final class Charsets extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static Charset |
GB2312 |
static Charset |
GBK |
static Charset |
ISO_8859_1 |
static Charset |
US_ASCII |
static Charset |
UTF_16 |
static Charset |
UTF_16BE |
static Charset |
UTF_16LE |
static Charset |
UTF_8 |
| 限定符和类型 | 方法和说明 |
|---|---|
static CharsetDecoder |
decoder(Charset charset)
Returns a cached thread-local
CharsetDecoder for the specified Charset. |
static CharsetDecoder |
decoder(Charset charset,
CodingErrorAction codingErrorAction)
Returns a new
CharsetDecoder for the Charset with the specified error action. |
static CharsetDecoder |
decoder(Charset charset,
CodingErrorAction malformedInputAction,
CodingErrorAction unmappableCharacterAction)
Returns a new
CharsetDecoder for the Charset with specified error actions. |
static CharsetEncoder |
encoder(Charset charset)
Returns a cached thread-local
CharsetEncoder for the specified Charset. |
static CharsetEncoder |
encoder(Charset charset,
CodingErrorAction codingErrorAction)
Returns a new
CharsetEncoder for the Charset with the specified error action. |
static CharsetEncoder |
encoder(Charset charset,
CodingErrorAction malformedInputAction,
CodingErrorAction unmappableCharacterAction)
Returns a new
CharsetEncoder for the Charset with specified error actions. |
static Charset |
getCharset(Charset charset) |
static Charset |
getCharset(String name) |
static Charset |
getCharset(String name,
String defaultName) |
static Charset |
getDefault() |
public static final Charset GBK
public static final Charset GB2312
public static final Charset UTF_8
public static final Charset UTF_16BE
public static final Charset UTF_16LE
public static final Charset UTF_16
public static final Charset US_ASCII
public static final Charset ISO_8859_1
public static Charset getDefault()
public static CharsetEncoder encoder(@NonNull Charset charset, @NonNull CodingErrorAction malformedInputAction, @NonNull 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 errorscharsetpublic static CharsetEncoder encoder(@NonNull Charset charset, @NonNull 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 errorscharsetpublic static CharsetEncoder encoder(@NonNull Charset charset)
CharsetEncoder for the specified Charset.charset - The specified charsetcharsetpublic static CharsetDecoder decoder(@NonNull Charset charset, @NonNull CodingErrorAction malformedInputAction, @NonNull 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 errorscharsetpublic static CharsetDecoder decoder(@NonNull Charset charset, @NonNull 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 errorscharsetpublic static CharsetDecoder decoder(@NonNull Charset charset)
CharsetDecoder for the specified Charset.charset - The specified charsetcharsetCopyright © 2019. All rights reserved.