|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsun.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
enc
- representing encoding
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
input
- byte array containing text to be converted.inOff
- begin conversion at this offset in input array.inEnd
- stop conversion at this offset in input array (exclusive).output
- character array to receive conversion result.outOff
- start writing to output array at this offset.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()
public final int flush(char[] output, int outStart, int outEnd) throws java.lang.IllegalArgumentException, sun.io.ConversionBufferFullException, sun.io.MalformedInputException
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
sun.io.MalformedInputException
public final void setSubstitutionChars(char[] c) throws java.lang.IllegalArgumentException
c
- the substitution bytes
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()
public final int getMaxCharsPerByte()
public final void setSubstitutionMode(boolean doSub)
doSub
- if true, enable substitution mode.setSubstitutionChars(char[])
public final int getBadInputLength()
public final char[] getSubChars()
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
- exception thrown by super class' finalize methodpublic static final sun.io.ByteToCharConverter createConverter(java.lang.String enc) throws java.io.UnsupportedEncodingException
enc
- string
java.io.UnsupportedEncodingException
public java.lang.Object clone()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |