org.elasticsearch.common
Class Unicode

java.lang.Object
  extended by org.elasticsearch.common.Unicode

public class Unicode
extends java.lang.Object


Nested Class Summary
static class Unicode.UTF16Result
           
 
Constructor Summary
Unicode()
           
 
Method Summary
static java.lang.String fromBytes(byte[] source)
           
static java.lang.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(java.lang.String source)
           
static org.apache.lucene.util.UnicodeUtil.UTF8Result fromStringAsUtf8(java.lang.String source)
           
static Unicode.UTF16Result unsafeFromBytesAsUtf16(byte[] source)
           
static Unicode.UTF16Result unsafeFromBytesAsUtf16(byte[] source, int offset, int length)
           
static org.apache.lucene.util.UnicodeUtil.UTF8Result unsafeFromStringAsUtf8(java.lang.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(java.lang.String source)

fromStringAsUtf8

public static org.apache.lucene.util.UnicodeUtil.UTF8Result fromStringAsUtf8(java.lang.String source)

unsafeFromStringAsUtf8

public static org.apache.lucene.util.UnicodeUtil.UTF8Result unsafeFromStringAsUtf8(java.lang.String source)

fromBytes

public static java.lang.String fromBytes(byte[] source)

fromBytes

public static java.lang.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.