|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sun.io.ByteToCharConverter | +--com.ibm.icu4jni.converters.ByteToCharConverterICU
Field Summary |
Fields inherited from class sun.io.ByteToCharConverter |
badInputLength, byteOff, charOff, subChars, subMode |
Constructor Summary | |
ByteToCharConverterICU(java.lang.String enc)
Create an instance of ByteToCharConverterICU with the specified encoding. |
Method Summary | |
java.lang.Object |
clone()
Makes a complete copy of the current object. |
int |
convert(byte[] input,
int inOff,
int inEnd,
char[] output,
int outOff,
int outEnd)
Conversion through the JNI interface for ICU. |
static sun.io.ByteToCharConverter |
createConverter(java.lang.String enc)
Creates an ICU Converter of the specified encoding |
protected void |
finalize()
Releases the system resources by cleanly closing ICU converter opened |
int |
flush(char[] output,
int outStart,
int outEnd)
Writes any remaining output to the output buffer and resets the converter to its initial state. |
int |
getBadInputLength()
Returns the length, in bytes, of the input which caused a MalformedInputException. |
java.lang.String |
getCharacterEncoding()
Return the character set id |
int |
getMaxCharsPerByte()
Returns the maximum number of characters needed to convert a byte. |
char[] |
getSubChars()
Returns the substitution characters as an array of chars |
void |
reset()
Reset the state of the converter |
void |
setSubstitutionChars(char[] c)
Sets the substitution characters to use when the converter is in substitution mode. |
void |
setSubstitutionMode(boolean doSub)
Sets converter into substitution mode. |
Methods inherited from class sun.io.ByteToCharConverter |
convertAll, getConverter, getDefault, nextByteIndex, nextCharIndex, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ByteToCharConverterICU(java.lang.String enc) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
- if the converter could not be openedMethod Detail |
public int convert(byte[] input, int inOff, int inEnd, char[] output, int outOff, int outEnd) throws sun.io.ConversionBufferFullException, sun.io.UnknownCharacterException, sun.io.MalformedInputException, java.lang.IllegalArgumentException
convert
in class sun.io.ByteToCharConverter
input
- 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).
sun.io.MalformedInputException
- if the input buffer contains any
sequence of bytes that is illegal for the input character set.
sun.io.UnknownCharacterException
- for any character that
that cannot be converted to Unicode. Thrown only when converter
is not in substitution mode.
sun.io.ConversionBufferFullException
- if output array is filled prior
to converting all the input.
java.lang.IllegalArgumentException
- is thrown if any of the arrays
passed are nullpublic final java.lang.String getCharacterEncoding()
getCharacterEncoding
in class sun.io.ByteToCharConverter
public final int flush(char[] output, int outStart, int outEnd) throws java.lang.IllegalArgumentException, sun.io.ConversionBufferFullException
flush
in class sun.io.ByteToCharConverter
output
- char array to receive flushed output.outStart
- start writing to output array at this offset.outEnd
- stop writing to output array at this offset (exclusive).
sun.io.ConversionBufferFullException
- if output array is filled
before all the output can be flushed. flush will write what it can
to the output buffer and remember its state. An additional call to
flush with a new output buffer will conclude the operation.
java.lang.IllegalArgumentException
public final void setSubstitutionChars(char[] c) throws java.lang.IllegalArgumentException
setSubstitutionChars
in class sun.io.ByteToCharConverter
java.lang.IllegalArgumentException
- if given byte array is longer than
the value returned by the method getMaxBytesPerChar or if the
JNI interface has returned an error codesetSubstitutionMode(boolean)
,
getMaxCharsPerByte()
public final void reset()
reset
in class sun.io.ByteToCharConverter
public final int getMaxCharsPerByte()
getMaxCharsPerByte
in class sun.io.ByteToCharConverter
public final void setSubstitutionMode(boolean doSub)
setSubstitutionMode
in class sun.io.ByteToCharConverter
doSub
- if true, enable substitution mode.setSubstitutionChars(char[])
public final int getBadInputLength()
getBadInputLength
in class sun.io.ByteToCharConverter
public final char[] getSubChars()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- exception thrown by super class' finalize methodpublic static final sun.io.ByteToCharConverter createConverter(java.lang.String enc) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public java.lang.Object clone()
clone
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |