|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsun.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
enc
- representing encoding
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
input
- array containing Unicode characters to be converted.inOff
- begin conversion at this offset in input array.inEnd
- stop conversion at this offset in input array (exclusive).output
- byte 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 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
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()
public final void setSubstitutionBytes(byte[] c) throws java.lang.IllegalArgumentException
c
- array of bytes to used for substitution
java.lang.IllegalArgumentException
public final void reset()
public final int getMaxBytesPerChar()
public boolean canConvert(char c)
c
- the character to be converted
public boolean canConvert(int codeUnit)
codeUnit
- the Unicode codeunit as int value
public final int getBadInputLength()
public final void setSubstitutionMode(boolean doSub)
doSub
- if true, enable substitution mode.setSubstitutionBytes(byte[])
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
- exception thrown by super class' finalize methodpublic static final sun.io.CharToByteConverter 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 |