Top Description Fields Constructors Methods
io.netty.util

public final Class CharsetUtil

extends Object
Class Inheritance
Imports
io.netty.util.internal.InternalThreadLocalMap, java.nio.charset.Charset, .CharsetDecoder, .CharsetEncoder, .CodingErrorAction, java.util.Map

A utility class that provides various common operations and constants related with Charset and its relevant classes.

Field Summary

Modifier and TypeField and Description
private static final Charset[]
public static final Charset
ISO_8859_1

ISO Latin Alphabet No.

public static final Charset
US_ASCII

7-bit ASCII, as known as ISO646-US or the Basic Latin block of the Unicode character set

public static final Charset
UTF_16

16-bit UTF (UCS Transformation Format) whose byte order is identified by an optional byte-order mark

public static final Charset
UTF_16BE

16-bit UTF (UCS Transformation Format) whose byte order is big-endian

public static final Charset
UTF_16LE

16-bit UTF (UCS Transformation Format) whose byte order is little-endian

public static final Charset
UTF_8

8-bit UTF (UCS Transformation Format)

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static CharsetDecoder

Returns:

The decoder for the specified charset
decoder
(Charset
The specified charset
charset
,
CodingErrorAction
The decoder's action for malformed-input errors
malformedInputAction
,
CodingErrorAction
The decoder's action for unmappable-character errors
unmappableCharacterAction
)

Returns a new CharsetDecoder for the Charset with specified error actions.

public static CharsetDecoder

Returns:

The decoder for the specified charset
decoder
(Charset
The specified charset
charset
,
CodingErrorAction
The decoder's action for malformed-input and unmappable-character errors
codingErrorAction
)

Returns a new CharsetDecoder for the Charset with the specified error action.

public static CharsetDecoder

Returns:

The decoder for the specified charset
decoder
(Charset
The specified charset
charset
)

Returns a cached thread-local CharsetDecoder for the specified Charset.

public static CharsetEncoder

Returns:

The encoder for the specified charset
encoder
(Charset
The specified charset
charset
,
CodingErrorAction
The encoder's action for malformed-input errors
malformedInputAction
,
CodingErrorAction
The encoder's action for unmappable-character errors
unmappableCharacterAction
)

Returns a new CharsetEncoder for the Charset with specified error actions.

public static CharsetEncoder

Returns:

The encoder for the specified charset
encoder
(Charset
The specified charset
charset
,
CodingErrorAction
The encoder's action for malformed-input and unmappable-character errors
codingErrorAction
)

Returns a new CharsetEncoder for the Charset with the specified error action.

public static CharsetEncoder

Returns:

The encoder for the specified charset
encoder
(Charset
The specified charset
charset
)

Returns a cached thread-local CharsetEncoder for the specified Charset.

public static CharsetDecoder
getDecoder(Charset charset)

Deprecated Use decoder(Charset).
public static CharsetEncoder
getEncoder(Charset charset)

Deprecated Use encoder(Charset).
public static Charset[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CHARSETSback to summary
private static final Charset[] CHARSETS
ISO_8859_1back to summary
public static final Charset ISO_8859_1

ISO Latin Alphabet No. 1, as known as ISO-LATIN-1

US_ASCIIback to summary
public static final Charset US_ASCII

7-bit ASCII, as known as ISO646-US or the Basic Latin block of the Unicode character set

UTF_16back to summary
public static final Charset UTF_16

16-bit UTF (UCS Transformation Format) whose byte order is identified by an optional byte-order mark

UTF_16BEback to summary
public static final Charset UTF_16BE

16-bit UTF (UCS Transformation Format) whose byte order is big-endian

UTF_16LEback to summary
public static final Charset UTF_16LE

16-bit UTF (UCS Transformation Format) whose byte order is little-endian

UTF_8back to summary
public static final Charset UTF_8

8-bit UTF (UCS Transformation Format)

Constructor Detail

CharsetUtilback to summary
private CharsetUtil()

Method Detail

decoderback to summary
public static CharsetDecoder decoder(Charset charset, CodingErrorAction malformedInputAction, CodingErrorAction unmappableCharacterAction)

Returns a new CharsetDecoder for the Charset with specified error actions.

Parameters
charset:Charset

The specified charset

malformedInputAction:CodingErrorAction

The decoder's action for malformed-input errors

unmappableCharacterAction:CodingErrorAction

The decoder's action for unmappable-character errors

Returns:CharsetDecoder

The decoder for the specified charset

decoderback to summary
public static CharsetDecoder decoder(Charset charset, CodingErrorAction codingErrorAction)

Returns a new CharsetDecoder for the Charset with the specified error action.

Parameters
charset:Charset

The specified charset

codingErrorAction:CodingErrorAction

The decoder's action for malformed-input and unmappable-character errors

Returns:CharsetDecoder

The decoder for the specified charset

decoderback to summary
public static CharsetDecoder decoder(Charset charset)

Returns a cached thread-local CharsetDecoder for the specified Charset.

Parameters
charset:Charset

The specified charset

Returns:CharsetDecoder

The decoder for the specified charset

encoderback to summary
public static CharsetEncoder encoder(Charset charset, CodingErrorAction malformedInputAction, CodingErrorAction unmappableCharacterAction)

Returns a new CharsetEncoder for the Charset with specified error actions.

Parameters
charset:Charset

The specified charset

malformedInputAction:CodingErrorAction

The encoder's action for malformed-input errors

unmappableCharacterAction:CodingErrorAction

The encoder's action for unmappable-character errors

Returns:CharsetEncoder

The encoder for the specified charset

encoderback to summary
public static CharsetEncoder encoder(Charset charset, CodingErrorAction codingErrorAction)

Returns a new CharsetEncoder for the Charset with the specified error action.

Parameters
charset:Charset

The specified charset

codingErrorAction:CodingErrorAction

The encoder's action for malformed-input and unmappable-character errors

Returns:CharsetEncoder

The encoder for the specified charset

encoderback to summary
public static CharsetEncoder encoder(Charset charset)

Returns a cached thread-local CharsetEncoder for the specified Charset.

Parameters
charset:Charset

The specified charset

Returns:CharsetEncoder

The encoder for the specified charset

getDecoderback to summary
public static CharsetDecoder getDecoder(Charset charset)

Deprecated

Use decoder(Charset).

Annotations
@Deprecated
getEncoderback to summary
public static CharsetEncoder getEncoder(Charset charset)

Deprecated

Use encoder(Charset).

Annotations
@Deprecated
valuesback to summary
public static Charset[] values()