|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sun.io.CharToByteConverter | +--com.ibm.icu4jni.converters.CharToByteConverterICU
Field Summary |
Fields inherited from class sun.io.CharToByteConverter |
badInputLength, byteOff, charOff, subBytes, subMode |
Constructor Summary | |
CharToByteConverterICU(java.lang.String enc)
Create an instance of CharToByteConverterICU with the specified encoding. |
Method Summary | |
boolean |
canConvert(char c)
Ascertains if a given Unicode character can be converted to the target encoding |
boolean |
canConvert(int codeUnit)
Ascertains if a given Unicode codeunit (32bit value for handling surrogates) can be converted to the target encoding. |
java.lang.Object |
clone()
Makes a complete copy of the current object. |
int |
convert(char[] input,
int inOff,
int inEnd,
byte[] output,
int outOff,
int outEnd)
Conversion through the JNI interface for ICU. |
static sun.io.CharToByteConverter |
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(byte[] 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 chars, of the input which caused a MalformedInputException. |
java.lang.String |
getCharacterEncoding()
Return the character set id |
int |
getMaxBytesPerChar()
Returns the max number of bytes needed for converting a Unicode character to target encoding |
void |
reset()
Reset the state of the converter |
void |
setSubstitutionBytes(byte[] c)
Sets the substitution bytes |
void |
setSubstitutionMode(boolean doSub)
Sets converter into substitution mode. |
Methods inherited from class sun.io.CharToByteConverter |
convertAll, convertAny, flushAny, getConverter, getDefault, nextByteIndex, nextCharIndex, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CharToByteConverterICU(java.lang.String enc) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
- if the converter could not be openedMethod Detail |
public int convert(char[] input, int inOff, int inEnd, byte[] output, int outOff, int outEnd) throws sun.io.ConversionBufferFullException, sun.io.UnknownCharacterException, sun.io.MalformedInputException, java.lang.IllegalArgumentException
convert
in class sun.io.CharToByteConverter
input
- array containing Unicode characters 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).
sun.io.MalformedInputException
- if the input buffer contains any
sequence of chars that is illegal in Unicode (principally unpaired
surrogates and ? or ?). After this exception is thrown,
the method nextCharIndex can be called to obtain the index of the
first invalid input character. The MalformedInputException can
be queried for the length of the invalid input.
sun.io.UnknownCharacterException
- for any character that
that cannot be converted to the external character encoding. 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
public final int flush(byte[] output, int outStart, int outEnd) throws java.lang.IllegalArgumentException, sun.io.ConversionBufferFullException
flush
in class sun.io.CharToByteConverter
output
- byte 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 java.lang.String getCharacterEncoding()
getCharacterEncoding
in class sun.io.CharToByteConverter
public final void setSubstitutionBytes(byte[] c) throws java.lang.IllegalArgumentException
setSubstitutionBytes
in class sun.io.CharToByteConverter
java.lang.IllegalArgumentException
public final void reset()
reset
in class sun.io.CharToByteConverter
public final int getMaxBytesPerChar()
getMaxBytesPerChar
in class sun.io.CharToByteConverter
public boolean canConvert(char c)
canConvert
in class sun.io.CharToByteConverter
public boolean canConvert(int codeUnit)
public final int getBadInputLength()
getBadInputLength
in class sun.io.CharToByteConverter
public final void setSubstitutionMode(boolean doSub)
setSubstitutionMode
in class sun.io.CharToByteConverter
doSub
- if true, enable substitution mode.setSubstitutionBytes(byte[])
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.CharToByteConverter 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 |