|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.api.util.Unicode
public final class Unicode
Various unicode manipulation methods that are more efficient then chaining operations: all is done in the same buffer without creating a bunch of string objects.
| Constructor Summary | |
|---|---|
Unicode()
|
|
| Method Summary | |
|---|---|
static char |
bytesToChar(byte[] bytes)
Return the Unicode char which is coded in the bytes at position 0. |
static char |
bytesToChar(byte[] bytes,
int pos)
Return the Unicode char which is coded in the bytes at the given position. |
static byte[] |
charToBytes(char car)
Return the Unicode char which is coded in the bytes at the given position. |
static int |
countBytes(char[] chars)
Count the number of bytes included in the given char[]. |
static int |
countBytesPerChar(byte[] bytes,
int pos)
Count the number of bytes needed to return an Unicode char. |
static int |
countChars(byte[] bytes)
Count the number of chars included in the given byte[]. |
static int |
countNbBytesPerChar(char car)
Return the number of bytes that hold an Unicode char. |
static boolean |
isUnicodeSubset(byte b)
Check if the current byte is in the unicodeSubset : all chars but '\0', '(', ')', '*' and '\' |
static boolean |
isUnicodeSubset(char c)
Check if the current char is in the unicodeSubset : all chars but '\0', '(', ')', '*' and '\' |
static boolean |
isUnicodeSubset(String str,
int pos)
Check if the current char is in the unicodeSubset : all chars but '\0', '(', ')', '*' and '\' |
static String |
readUTF(ObjectInput objectInput)
Reads in a string that has been encoded using a modified UTF-8 format. |
static void |
writeUTF(ObjectOutput objectOutput,
String str)
Writes four bytes of length information to the output stream, followed by the modified UTF-8 representation of every character in the string str. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Unicode()
| Method Detail |
|---|
public static int countBytesPerChar(byte[] bytes,
int pos)
bytes - The bytes to readpos - Position to start counting. It must be a valid start of a
encoded char !
public static char bytesToChar(byte[] bytes)
bytes - The byte[] represntation of an Unicode string.
public static char bytesToChar(byte[] bytes,
int pos)
bytes - The byte[] represntation of an Unicode string.pos - The current position to start decoding the char
public static int countNbBytesPerChar(char car)
car - The character to be decoded
public static int countBytes(char[] chars)
chars - The char array to decode
public static int countChars(byte[] bytes)
bytes - The byte array to decode
public static byte[] charToBytes(char car)
car - The character to be transformed to an array of bytes
public static boolean isUnicodeSubset(String str,
int pos)
str - The string to checkpos - Position of the current char
public static boolean isUnicodeSubset(char c)
c - The char to check
public static boolean isUnicodeSubset(byte b)
b - The byte to check
public static void writeUTF(ObjectOutput objectOutput,
String str)
throws IOException
DataOutput.writeUTF(String).
objectOutput - The objectOutput to write tostr - The value to write
IOException - If the value can't be written to the file
public static String readUTF(ObjectInput objectInput)
throws IOException
DataInput.readUTF().
objectInput - The objectInput to read from
IOException - If the value can't be read
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||