|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jena.atlas.io.BlockUTF8
public class BlockUTF8
Convert between bytes and chars, UTF-8 only. This code is just the UTF-8 encoding rules - it does not check for legality of the Unicode data. The standard codec do, so do not round-trip with binary compatibility. (Example: a single element of a surrogate pair will be encoded/decoded without lost. The usual Charset encoders/decoders can be expensive to start up - they are also not thread safe. Sometimes we want to convert 10's of chars and UTF-8 can be done in code with no lookup tables (which, if used, are cache-unfriendly). This code is thread safe. It uses code in the hope that JITting will make it fast if used heavily.
Constructor Summary | |
---|---|
BlockUTF8()
|
Method Summary | |
---|---|
static void |
fromChars(CharBuffer cb,
ByteBuffer bb)
Convert characters to UTF-8 bytes in the ByteBuffer. |
static void |
fromChars(CharSequence cs,
ByteBuffer bb)
|
static void |
toChars(ByteBuffer bb,
CharBuffer cb)
Convert the bytes in the ByteBuffer to characters in the CharBuffer. |
static String |
toString(ByteBuffer bb)
Make a string from UTF-8 bytes in a ByteBuffer |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BlockUTF8()
Method Detail |
---|
public static void toChars(ByteBuffer bb, CharBuffer cb)
public static void fromChars(CharBuffer cb, ByteBuffer bb)
public static String toString(ByteBuffer bb)
public static void fromChars(CharSequence cs, ByteBuffer bb)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |