net.csdn.common
Class Unicode

java.lang.Object
  extended by net.csdn.common.Unicode

public class Unicode
extends Object

BlogInfo: william Date: 11-9-5 Time: 下午10:18


Nested Class Summary
static class Unicode.UTF16Result
           
 
Constructor Summary
Unicode()
           
 
Method Summary
static String fromBytes(byte[] source)
           
static String fromBytes(byte[] source, int offset, int length)
           
static Unicode.UTF16Result fromBytesAsUtf16(byte[] source)
           
static Unicode.UTF16Result fromBytesAsUtf16(byte[] source, int offset, int length)
           
static byte[] fromStringAsBytes(String source)
           
static UnicodeUtil.UTF8Result fromStringAsUtf8(String source)
           
static Unicode.UTF16Result unsafeFromBytesAsUtf16(byte[] source)
           
static Unicode.UTF16Result unsafeFromBytesAsUtf16(byte[] source, int offset, int length)
           
static UnicodeUtil.UTF8Result unsafeFromStringAsUtf8(String source)
           
static void UTF8toUTF16(byte[] utf8, int offset, int length, Unicode.UTF16Result result)
          Convert UTF8 bytes into UTF16 characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Unicode

public Unicode()
Method Detail

fromStringAsBytes

public static byte[] fromStringAsBytes(String source)

fromStringAsUtf8

public static UnicodeUtil.UTF8Result fromStringAsUtf8(String source)

unsafeFromStringAsUtf8

public static UnicodeUtil.UTF8Result unsafeFromStringAsUtf8(String source)

fromBytes

public static String fromBytes(byte[] source)

fromBytes

public static String fromBytes(byte[] source,
                               int offset,
                               int length)

fromBytesAsUtf16

public static Unicode.UTF16Result fromBytesAsUtf16(byte[] source)

fromBytesAsUtf16

public static Unicode.UTF16Result fromBytesAsUtf16(byte[] source,
                                                   int offset,
                                                   int length)

unsafeFromBytesAsUtf16

public static Unicode.UTF16Result unsafeFromBytesAsUtf16(byte[] source)

unsafeFromBytesAsUtf16

public static Unicode.UTF16Result unsafeFromBytesAsUtf16(byte[] source,
                                                         int offset,
                                                         int length)

UTF8toUTF16

public static void UTF8toUTF16(byte[] utf8,
                               int offset,
                               int length,
                               Unicode.UTF16Result result)
Convert UTF8 bytes into UTF16 characters. If offset is non-zero, conversion starts at that starting point in utf8, re-using the results from the previous call up until offset.



Copyright © 2014. All Rights Reserved.