java.lang
Class StringCoding

java.lang.Object
  extended byjava.lang.StringCoding

class StringCoding
extends Object

Utility class for string encoding and decoding.


Nested Class Summary
private static class StringCoding.CharsetSD
           
private static class StringCoding.CharsetSE
           
private static class StringCoding.ConverterSD
           
private static class StringCoding.ConverterSE
           
private static class StringCoding.StringDecoder
           
private static class StringCoding.StringEncoder
           
 
Field Summary
private static ThreadLocal decoder
           
private static ThreadLocal encoder
           
private static boolean warnUnsupportedCharset
           
 
Constructor Summary
private StringCoding()
           
 
Method Summary
(package private) static char[] decode(byte[] ba, int off, int len)
           
(package private) static char[] decode(String charsetName, byte[] ba, int off, int len)
           
private static Object deref(ThreadLocal tl)
           
(package private) static byte[] encode(char[] ca, int off, int len)
           
(package private) static byte[] encode(String charsetName, char[] ca, int off, int len)
           
private static Charset lookupCharset(String csn)
           
private static void set(ThreadLocal tl, Object ob)
           
private static byte[] trim(byte[] ba, int len)
           
private static char[] trim(char[] ca, int len)
           
private static void warnUnsupportedCharset(String csn)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

decoder

private static ThreadLocal decoder

encoder

private static ThreadLocal encoder

warnUnsupportedCharset

private static boolean warnUnsupportedCharset
Constructor Detail

StringCoding

private StringCoding()
Method Detail

deref

private static Object deref(ThreadLocal tl)

set

private static void set(ThreadLocal tl,
                        Object ob)

trim

private static byte[] trim(byte[] ba,
                           int len)

trim

private static char[] trim(char[] ca,
                           int len)

lookupCharset

private static Charset lookupCharset(String csn)

warnUnsupportedCharset

private static void warnUnsupportedCharset(String csn)

decode

static char[] decode(String charsetName,
                     byte[] ba,
                     int off,
                     int len)
              throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

decode

static char[] decode(byte[] ba,
                     int off,
                     int len)

encode

static byte[] encode(String charsetName,
                     char[] ca,
                     int off,
                     int len)
              throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

encode

static byte[] encode(char[] ca,
                     int off,
                     int len)