Package org.jboss.netty.util
Class CharsetUtil
- java.lang.Object
-
- org.jboss.netty.util.CharsetUtil
-
public final class CharsetUtil extends java.lang.Object
A utility class that provides various common operations and constants related withCharset
and its relevant classes.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.ThreadLocal<java.util.Map<java.nio.charset.Charset,java.nio.charset.CharsetDecoder>>
decoders
private static java.lang.ThreadLocal<java.util.Map<java.nio.charset.Charset,java.nio.charset.CharsetEncoder>>
encoders
static java.nio.charset.Charset
ISO_8859_1
ISO Latin Alphabet No.static java.nio.charset.Charset
US_ASCII
7-bit ASCII, as known as ISO646-US or the Basic Latin block of the Unicode character setstatic java.nio.charset.Charset
UTF_16
16-bit UTF (UCS Transformation Format) whose byte order is identified by an optional byte-order markstatic java.nio.charset.Charset
UTF_16BE
16-bit UTF (UCS Transformation Format) whose byte order is big-endianstatic java.nio.charset.Charset
UTF_16LE
16-bit UTF (UCS Transformation Format) whose byte order is little-endianstatic java.nio.charset.Charset
UTF_8
8-bit UTF (UCS Transformation Format)
-
Constructor Summary
Constructors Modifier Constructor Description private
CharsetUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.nio.charset.CharsetDecoder
getDecoder(java.nio.charset.Charset charset)
Returns a cached thread-localCharsetDecoder
for the specified charset.static java.nio.charset.CharsetEncoder
getEncoder(java.nio.charset.Charset charset)
Returns a cached thread-localCharsetEncoder
for the specified charset.
-
-
-
Field Detail
-
UTF_16
public static final java.nio.charset.Charset UTF_16
16-bit UTF (UCS Transformation Format) whose byte order is identified by an optional byte-order mark
-
UTF_16BE
public static final java.nio.charset.Charset UTF_16BE
16-bit UTF (UCS Transformation Format) whose byte order is big-endian
-
UTF_16LE
public static final java.nio.charset.Charset UTF_16LE
16-bit UTF (UCS Transformation Format) whose byte order is little-endian
-
UTF_8
public static final java.nio.charset.Charset UTF_8
8-bit UTF (UCS Transformation Format)
-
ISO_8859_1
public static final java.nio.charset.Charset ISO_8859_1
ISO Latin Alphabet No. 1, as known as ISO-LATIN-1
-
US_ASCII
public static final java.nio.charset.Charset US_ASCII
7-bit ASCII, as known as ISO646-US or the Basic Latin block of the Unicode character set
-
encoders
private static final java.lang.ThreadLocal<java.util.Map<java.nio.charset.Charset,java.nio.charset.CharsetEncoder>> encoders
-
decoders
private static final java.lang.ThreadLocal<java.util.Map<java.nio.charset.Charset,java.nio.charset.CharsetDecoder>> decoders
-
-
Method Detail
-
getEncoder
public static java.nio.charset.CharsetEncoder getEncoder(java.nio.charset.Charset charset)
Returns a cached thread-localCharsetEncoder
for the specified charset.
-
getDecoder
public static java.nio.charset.CharsetDecoder getDecoder(java.nio.charset.Charset charset)
Returns a cached thread-localCharsetDecoder
for the specified charset.
-
-