Package io.netty.util
Class CharsetUtil
java.lang.Object
io.netty.util.CharsetUtil
A utility class that provides various common operations and constants
related with
Charset
and its relevant classes.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Charset[]
static final Charset
ISO Latin Alphabet No.static final Charset
7-bit ASCII, as known as ISO646-US or the Basic Latin block of the Unicode character setstatic final Charset
16-bit UTF (UCS Transformation Format) whose byte order is identified by an optional byte-order markstatic final Charset
16-bit UTF (UCS Transformation Format) whose byte order is big-endianstatic final Charset
16-bit UTF (UCS Transformation Format) whose byte order is little-endianstatic final Charset
8-bit UTF (UCS Transformation Format) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CharsetDecoder
Returns a cached thread-localCharsetDecoder
for the specifiedCharset
.static CharsetDecoder
decoder
(Charset charset, CodingErrorAction codingErrorAction) Returns a newCharsetDecoder
for theCharset
with the specified error action.static CharsetDecoder
decoder
(Charset charset, CodingErrorAction malformedInputAction, CodingErrorAction unmappableCharacterAction) Returns a newCharsetDecoder
for theCharset
with specified error actions.static CharsetEncoder
Returns a cached thread-localCharsetEncoder
for the specifiedCharset
.static CharsetEncoder
encoder
(Charset charset, CodingErrorAction codingErrorAction) Returns a newCharsetEncoder
for theCharset
with the specified error action.static CharsetEncoder
encoder
(Charset charset, CodingErrorAction malformedInputAction, CodingErrorAction unmappableCharacterAction) Returns a newCharsetEncoder
for theCharset
with specified error actions.static CharsetDecoder
getDecoder
(Charset charset) Deprecated.static CharsetEncoder
getEncoder
(Charset charset) Deprecated.Useencoder(Charset)
.static Charset[]
values()
-
Field Details
-
UTF_16
16-bit UTF (UCS Transformation Format) whose byte order is identified by an optional byte-order mark -
UTF_16BE
16-bit UTF (UCS Transformation Format) whose byte order is big-endian -
UTF_16LE
16-bit UTF (UCS Transformation Format) whose byte order is little-endian -
UTF_8
8-bit UTF (UCS Transformation Format) -
ISO_8859_1
ISO Latin Alphabet No. 1, as known as ISO-LATIN-1 -
US_ASCII
7-bit ASCII, as known as ISO646-US or the Basic Latin block of the Unicode character set -
CHARSETS
-
-
Constructor Details
-
CharsetUtil
private CharsetUtil()
-
-
Method Details
-
values
-
getEncoder
Deprecated.Useencoder(Charset)
. -
encoder
public static CharsetEncoder encoder(Charset charset, CodingErrorAction malformedInputAction, CodingErrorAction unmappableCharacterAction) Returns a newCharsetEncoder
for theCharset
with specified error actions.- Parameters:
charset
- The specified charsetmalformedInputAction
- The encoder's action for malformed-input errorsunmappableCharacterAction
- The encoder's action for unmappable-character errors- Returns:
- The encoder for the specified
charset
-
encoder
Returns a newCharsetEncoder
for theCharset
with the specified error action.- Parameters:
charset
- The specified charsetcodingErrorAction
- The encoder's action for malformed-input and unmappable-character errors- Returns:
- The encoder for the specified
charset
-
encoder
Returns a cached thread-localCharsetEncoder
for the specifiedCharset
.- Parameters:
charset
- The specified charset- Returns:
- The encoder for the specified
charset
-
getDecoder
Deprecated.Usedecoder(Charset)
. -
decoder
public static CharsetDecoder decoder(Charset charset, CodingErrorAction malformedInputAction, CodingErrorAction unmappableCharacterAction) Returns a newCharsetDecoder
for theCharset
with specified error actions.- Parameters:
charset
- The specified charsetmalformedInputAction
- The decoder's action for malformed-input errorsunmappableCharacterAction
- The decoder's action for unmappable-character errors- Returns:
- The decoder for the specified
charset
-
decoder
Returns a newCharsetDecoder
for theCharset
with the specified error action.- Parameters:
charset
- The specified charsetcodingErrorAction
- The decoder's action for malformed-input and unmappable-character errors- Returns:
- The decoder for the specified
charset
-
decoder
Returns a cached thread-localCharsetDecoder
for the specifiedCharset
.- Parameters:
charset
- The specified charset- Returns:
- The decoder for the specified
charset
-
decoder(Charset)
.