|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glassfish.grizzly.utils.Charsets
public final class Charsets
Charset utility class.
Field Summary | |
---|---|
static Charset |
ASCII_CHARSET
|
static int |
CODECS_CACHE_SIZE
|
static String |
DEFAULT_CHARACTER_ENCODING
The default character encoding of this Java virtual machine. |
static Charset |
DEFAULT_CHARSET
Returns the default charset of this Java virtual machine. |
static Charset |
UTF8_CHARSET
|
Constructor Summary | |
---|---|
Charsets()
|
Method Summary | |
---|---|
static void |
drainAllCharsets()
Remove all preloaded charsets. |
static CharsetDecoder |
getCharsetDecoder(Charset charset)
Return the Charset 's CharsetDecoder . |
static CharsetEncoder |
getCharsetEncoder(Charset charset)
Return the Charset 's CharsetEncoder . |
static Charset |
lookupCharset(String charsetName)
Lookup a Charset by name. |
static void |
preloadAllCharsets()
Preloads all Charset s available to the JMV, which makes charset
searching faster (at the cost of memory). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_CHARACTER_ENCODING
public static final Charset ASCII_CHARSET
public static final Charset UTF8_CHARSET
public static final Charset DEFAULT_CHARSET
Charset.defaultCharset()
public static final int CODECS_CACHE_SIZE
Constructor Detail |
---|
public Charsets()
Method Detail |
---|
public static Charset lookupCharset(String charsetName)
Charset
by name.
Fixes Charset concurrency issue (http://paul.vox.com/library/post/the-mysteries-of-java-character-set-performance.html)
charsetName
-
Charset
public static void preloadAllCharsets()
Charset
s available to the JMV, which makes charset
searching faster (at the cost of memory). The speed gain is most noticable
in the case of non-existing charsets as it allows us to avoid an expensive
call to Charset.forName(java.lang.String)
.
public static void drainAllCharsets()
public static CharsetDecoder getCharsetDecoder(Charset charset)
Charset
's CharsetDecoder
.
The Charsets class maintains the CharsetDecoder
thread-local
cache. Be aware - this shouldn't be used by multiple threads.
charset
- Charset
.
Charset
's CharsetDecoder
.public static CharsetEncoder getCharsetEncoder(Charset charset)
Charset
's CharsetEncoder
.
The Charsets class maintains the CharsetEncoder
thread-local
cache. Be aware - this shouldn't be used by multiple threads.
charset
- Charset
.
Charset
's CharsetEncoder
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |