|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.icu4jni.converters.NativeConverter
Class for accessing the underlying JNI methods
Field Summary | |
static int |
SKIP_CALLBACK
|
static int |
STOP_CALLBACK
|
static int |
SUBSTITUTE_CALLBACK
|
Constructor Summary | |
NativeConverter()
|
Method Summary | |
static boolean |
canDecode(long converterHandle,
byte[] bytes)
Ascertains if a given a byte sequence can be converted to Unicode |
static boolean |
canEncode(long converterHandle,
int codeUnit)
Ascertains if a given Unicode code unit can be converted to the target encoding |
static void |
closeConverter(long converterHandle)
Closes the specified converter and releases the resources |
static boolean |
contains(long converterHandle1,
long converterHandle2)
Determines whether charset1 contains charset2. |
static int |
convertByteToChar(long converterHandle,
byte[] input,
int inEnd,
char[] output,
int outEnd,
int[] data,
boolean flush)
Converts an array of bytes containing characters in an external encoding into an array of Unicode characters. |
static int |
convertCharToByte(long converterHandle,
char[] input,
int inEnd,
byte[] output,
int outEnd,
int[] data,
boolean flush)
Converts an array of Unicode chars containing characters in an external encoding into an array of bytes. |
static int |
countAliases(java.lang.String enc)
Gets the number of aliases for a converter name |
static int |
countAvailable()
Gets the number of converters installed in the current installation of ICU |
static int |
countInvalidBytes(long converterHandle,
int[] length)
Gets the numnber of invalid bytes in the specified converter object for the last error that has occured |
static int |
countInvalidChars(long converterHandle,
int[] length)
Gets the numnber of invalid chars in the specified converter object for the last error that has occured |
static int |
decode(long converterHandle,
byte[] input,
int inEnd,
char[] output,
int outEnd,
int[] data,
boolean flush)
Converts an array of bytes containing characters in an external encoding into an array of Unicode characters. |
static int |
encode(long converterHandle,
char[] input,
int inEnd,
byte[] output,
int outEnd,
int[] data,
boolean flush)
Converts an array of Unicode chars containing characters in an external encoding into an array of bytes. |
static int |
flushByteToChar(long converterHandle,
char[] output,
int outEnd,
int[] data)
Writes any remaining output to the output buffer and resets the converter to its initial state. |
static int |
flushCharToByte(long converterHandle,
byte[] output,
int outEnd,
int[] data)
Writes any remaining output to the output buffer and resets the converter to its initial state. |
static java.lang.String[] |
getAliases(java.lang.String enc)
Gets the aliases associated with the converter name |
static java.lang.String[] |
getAvailable()
Gets the canonical names of available converters |
static float |
getAveBytesPerChar(long converterHandle)
Gets the average numnber of bytes needed for converting a char |
static float |
getAveCharsPerByte(long converterHandle)
Gets the average numnber of chars needed for converting a byte |
static java.lang.String |
getCanonicalName(java.lang.String enc)
Gets the canonical name of the converter |
static java.lang.String |
getICUCanonicalName(java.lang.String enc)
Gets the canonical name of the converter as defined by Java |
static java.lang.String |
getJavaCanonicalName(java.lang.String icuCanonicalName)
Gets the canonical name of the converter as defined by Java |
static int |
getMaxBytesPerChar(long converterHandle)
Gets the number of bytes needed for converting a char |
static int |
getMaxCharsPerByte(long converterHandle)
Gets the number of chars needed for converting a byte |
static int |
getMinBytesPerChar(long converterHandle)
Gets the number of bytes needed for converting a char |
static byte[] |
getSubstitutionBytes(long converterHandle)
|
static int |
openConverter(long[] converterHandle,
java.lang.String encoding)
Open the converter with the specified encoding |
static void |
resetByteToChar(long converterHandle)
Resets the ByteToChar (toUnicode) state of specified converter |
static void |
resetCharToByte(long converterHandle)
Resets the CharToByte (fromUnicode) state of specified converter |
static int |
safeClone(long converterHandle,
long[] handleArr)
Returns a thread safe clone of the converter |
static int |
setCallbackDecode(long converterHandle,
int onMalformedInput,
int onUnmappableInput,
char[] subChars,
int length)
Sets the callback to Unicode for ICU conveter. |
static int |
setCallbackEncode(long converterHandle,
int onMalformedInput,
int onUnmappableInput,
byte[] subBytes,
int length)
Sets the callback from Unicode for ICU conveter. |
static int |
setSubstitutionBytes(long converterHandle,
byte[] subChars,
int length)
Sets the substitution bytes of the specified converter used by decoder |
static int |
setSubstitutionChars(long converterHandle,
char[] subChars,
int length)
Sets the substitution Unicode chars of the specified converter used by encoder |
static int |
setSubstitutionModeByteToChar(long converterHandle,
boolean mode)
Sets the substitution mode of CharToByte(fromUnicode) for the specified converter |
static int |
setSubstitutionModeCharToByte(long converterHandle,
boolean mode)
Sets the substitution mode of CharToByte(fromUnicode) for the specified converter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int STOP_CALLBACK
public static final int SKIP_CALLBACK
public static final int SUBSTITUTE_CALLBACK
Constructor Detail |
public NativeConverter()
Method Detail |
public static final int convertByteToChar(long converterHandle, byte[] input, int inEnd, char[] output, int outEnd, int[] data, boolean flush)
converterHandle
- Address of converter object created by C codeinput
- byte array containing text to be converted.inEnd
- stop conversion at this offset in input array (exclusive).output
- character array to receive conversion result.outEnd
- stop writing to output array at this offset (exclusive).data
- integer array containing the following data
data[0] = inputOffset
data[1] = outputOffset
public static final int decode(long converterHandle, byte[] input, int inEnd, char[] output, int outEnd, int[] data, boolean flush)
converterHandle
- Address of converter object created by C codeinput
- byte array containing text to be converted.inEnd
- stop conversion at this offset in input array (exclusive).output
- character array to receive conversion result.outEnd
- stop writing to output array at this offset (exclusive).data
- integer array containing the following data
data[0] = inputOffset
data[1] = outputOffset
public static final int convertCharToByte(long converterHandle, char[] input, int inEnd, byte[] output, int outEnd, int[] data, boolean flush)
converterHandle
- Address of converter object created by C codeinput
- char array containing text to be converted.inEnd
- stop conversion at this offset in input array (exclusive).output
- byte array to receive conversion result.outEnd
- stop writing to output array at this offset (exclusive).data
- integer array containing the following data
data[0] = inputOffset
data[1] = outputOffset
public static final int encode(long converterHandle, char[] input, int inEnd, byte[] output, int outEnd, int[] data, boolean flush)
converterHandle
- Address of converter object created by C codeinput
- char array containing text to be converted.inEnd
- stop conversion at this offset in input array (exclusive).output
- byte array to receive conversion result.outEnd
- stop writing to output array at this offset (exclusive).data
- integer array containing the following data
data[0] = inputOffset
data[1] = outputOffset
public static final int flushCharToByte(long converterHandle, byte[] output, int outEnd, int[] data)
converterHandle
- Address of converter object created by C codeoutput
- byte array to receive flushed output.outEnd
- stop writing to output array at this offset (exclusive).data
- integer array containing the following data
data[0] = inputOffset
data[1] = outputOffset
public static final int flushByteToChar(long converterHandle, char[] output, int outEnd, int[] data)
converterHandle
- Address of converter object created by the native codeoutput
- char array to receive flushed output.outEnd
- stop writing to output array at this offset (exclusive).data
- integer array containing the following data
data[0] = inputOffset
data[1] = outputOffset
public static final int openConverter(long[] converterHandle, java.lang.String encoding)
converterHandle
- long array for recieving the adress of converter object
created by the native codeencoding
- string representing encoding
public static final void resetByteToChar(long converterHandle)
converterHandle
- Address of converter object created by the native codepublic static final void resetCharToByte(long converterHandle)
converterHandle
- Address of converter object created by the native codepublic static final void closeConverter(long converterHandle)
converterHandle
- Address of converter object created by the native codepublic static final int setSubstitutionChars(long converterHandle, char[] subChars, int length)
converterHandle
- Address of converter object created by the native codesubChars
- array of chars to used for substitutionlength
- length of the array
public static final int setSubstitutionBytes(long converterHandle, byte[] subChars, int length)
converterHandle
- Address of converter object created by the native codesubChars
- array of bytes to used for substitutionlength
- length of the array
public static final int setSubstitutionModeCharToByte(long converterHandle, boolean mode)
converterHandle
- Address of converter object created by the native codemode
- to set the true/false
public static final int setSubstitutionModeByteToChar(long converterHandle, boolean mode)
converterHandle
- Address of converter object created by the native codemode
- to set the true/false
public static final int countInvalidBytes(long converterHandle, int[] length)
converterHandle
- Address of converter object created by the native codelength
- array of int to recieve length of the array
public static final int countInvalidChars(long converterHandle, int[] length)
converterHandle
- Address of converter object created by the native codelength
- array of int to recieve length of the array
public static final int getMaxBytesPerChar(long converterHandle)
converterHandle
- Address of converter object created by the native code
public static final int getMinBytesPerChar(long converterHandle)
converterHandle
- Address of converter object created by the native code
public static final float getAveBytesPerChar(long converterHandle)
converterHandle
- Address of converter object created by the native code
public static final int getMaxCharsPerByte(long converterHandle)
converterHandle
- Address of converter object created by the native code
public static final float getAveCharsPerByte(long converterHandle)
converterHandle
- Address of converter object created by the native code
public static final boolean contains(long converterHandle1, long converterHandle2)
public static final byte[] getSubstitutionBytes(long converterHandle)
public static final boolean canEncode(long converterHandle, int codeUnit)
converterHandle
- Address of converter object created by the native codecodeUnit
- the character to be converted
public static final boolean canDecode(long converterHandle, byte[] bytes)
converterHandle
- Address of converter object created by the native codebytes
- the bytes to be converted
public static final int countAvailable()
public static final java.lang.String[] getAvailable()
public static final int countAliases(java.lang.String enc)
enc
- encoding name
public static final java.lang.String[] getAliases(java.lang.String enc)
enc
- converter name
public static final java.lang.String getCanonicalName(java.lang.String enc)
enc
- converter name
public static final java.lang.String getICUCanonicalName(java.lang.String enc)
enc
- converter name
public static final java.lang.String getJavaCanonicalName(java.lang.String icuCanonicalName)
icuCanonicalName
- converter name
public static final int setCallbackDecode(long converterHandle, int onMalformedInput, int onUnmappableInput, char[] subChars, int length)
converterHandle
- Adress of the converter object created by native code
public static final int setCallbackEncode(long converterHandle, int onMalformedInput, int onUnmappableInput, byte[] subBytes, int length)
converterHandle
- Adress of the converter object created by native code
public static final int safeClone(long converterHandle, long[] handleArr)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |