| com.ibm.icu.charset.CharsetDecoderICU
CharsetDecoderICU | abstract public class CharsetDecoderICU extends CharsetDecoder (Code) | | An abstract class that provides framework methods of decoding operations for concrete
subclasses.
In the future this class will contain API that will implement converter sematics of ICU4C.
|
Constructor Summary | |
| CharsetDecoderICU(CharsetICU cs) Construct a CharsetDecorderICU based on the information provided from a
CharsetICU object.
Parameters: cs - The CharsetICU object containing information about how tocharset to decode. |
Method Summary | |
CoderResult | cbToUWriteSub(CharsetDecoderICU decoder, ByteBuffer source, CharBuffer target, IntBuffer offsets) This function will write out the Unicode substitution character to the
target character buffer. | final CoderResult | decode(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) Implements the ICU semantic for decode operation
Parameters: source - The input byte buffer Parameters: target - The output character buffer Parameters: offsets - Parameters: flush - true if, and only if, the invoker can provide noadditional input bytes beyond those in the given buffer. | protected CoderResult | decodeLoop(ByteBuffer in, CharBuffer out) Decodes one or more bytes. | abstract CoderResult | decodeLoop(ByteBuffer in, CharBuffer out, IntBuffer offsets, boolean flush) Implements the ICU semantic for decode operation
Parameters: in - The input byte buffer Parameters: out - The output character buffer Result of decoding action. | final protected CoderResult | implFlush(CharBuffer out) Flushes any characters saved in the converter's internal buffer and
resets the converter.
Parameters: out - action to be taken result of flushing action and completes the decoding all input. | final protected void | implOnMalformedInput(CodingErrorAction newAction) | final protected void | implOnUnmappableCharacter(CodingErrorAction newAction) | protected void | implReset() | int | toUCountPending() Returns the number of chars held in the converter's internal state
because more input is needed for completing the conversion. | final static CoderResult | toUWriteUChars(CharsetDecoderICU cnv, char[] ucharsArray, int ucharsBegin, int length, CharBuffer target, IntBuffer offsets, int sourceIndex) ONLY used by ToU callback functions. | final CoderResult | toUnicodeWithCallback(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) |
charErrorBufferArray | char[] charErrorBufferArray(Code) | | |
charErrorBufferBegin | int charErrorBufferBegin(Code) | | |
charErrorBufferLength | int charErrorBufferLength(Code) | | |
invalidCharBuffer | char[] invalidCharBuffer(Code) | | |
invalidCharLength | int invalidCharLength(Code) | | |
preToUArray | byte[] preToUArray(Code) | | |
preToUBegin | int preToUBegin(Code) | | |
preToUFirstLength | int preToUFirstLength(Code) | | |
preToULength | int preToULength(Code) | | |
toUBytesArray | byte[] toUBytesArray(Code) | | |
toUBytesBegin | int toUBytesBegin(Code) | | |
toUnicodeStatus | int toUnicodeStatus(Code) | | |
CharsetDecoderICU | CharsetDecoderICU(CharsetICU cs)(Code) | | Construct a CharsetDecorderICU based on the information provided from a
CharsetICU object.
Parameters: cs - The CharsetICU object containing information about how tocharset to decode. |
cbToUWriteSub | CoderResult cbToUWriteSub(CharsetDecoderICU decoder, ByteBuffer source, CharBuffer target, IntBuffer offsets)(Code) | | This function will write out the Unicode substitution character to the
target character buffer.
Sub classes to override this method if required
Parameters: decoder - Parameters: source - Parameters: target - Parameters: offsets - A CoderResult object that contains the error result when an error occurs. |
decode | final CoderResult decode(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush)(Code) | | Implements the ICU semantic for decode operation
Parameters: source - The input byte buffer Parameters: target - The output character buffer Parameters: offsets - Parameters: flush - true if, and only if, the invoker can provide noadditional input bytes beyond those in the given buffer. Result of decoding action. Returns CoderResult.UNDERFLOW if the decodingaction succeeds or more input is needed for completing the decoding action. |
decodeLoop | protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out)(Code) | | Decodes one or more bytes. The default behaviour of the converter
is stop and report if an error in input stream is encountered.
To set different behaviour use @see CharsetDecoder.onMalformedInput()
This method allows a buffer by buffer conversion of a data stream.
The state of the conversion is saved between calls to convert.
Among other things, this means multibyte input sequences can be
split between calls. If a call to convert results in an Error, the
conversion may be continued by calling convert again with suitably
modified parameters.All conversions should be finished with a call to
the flush method.
Parameters: in - buffer to decode Parameters: out - buffer to populate with decoded result Result of decoding action. Returns CoderResult.UNDERFLOW if the decodingaction succeeds or more input is needed for completing the decoding action. |
decodeLoop | abstract CoderResult decodeLoop(ByteBuffer in, CharBuffer out, IntBuffer offsets, boolean flush)(Code) | | Implements the ICU semantic for decode operation
Parameters: in - The input byte buffer Parameters: out - The output character buffer Result of decoding action. Returns CoderResult.UNDERFLOW if the decodingaction succeeds or more input is needed for completing the decoding action. |
implFlush | final protected CoderResult implFlush(CharBuffer out)(Code) | | Flushes any characters saved in the converter's internal buffer and
resets the converter.
Parameters: out - action to be taken result of flushing action and completes the decoding all input. Returns CoderResult.UNDERFLOW if the action succeeds. |
implOnMalformedInput | final protected void implOnMalformedInput(CodingErrorAction newAction)(Code) | | Sets the action to be taken if an illegal sequence is encountered
Parameters: newAction - action to be taken exception: IllegalArgumentException - |
implOnUnmappableCharacter | final protected void implOnUnmappableCharacter(CodingErrorAction newAction)(Code) | | Sets the action to be taken if an illegal sequence is encountered
Parameters: newAction - action to be taken exception: IllegalArgumentException - |
implReset | protected void implReset()(Code) | | Resets the to Unicode mode of converter
|
toUCountPending | int toUCountPending()(Code) | | Returns the number of chars held in the converter's internal state
because more input is needed for completing the conversion. This function is
useful for mapping semantics of ICU's converter interface to those of iconv,
and this information is not needed for normal conversion.
The number of chars in the state. -1 if an error is encountered. |
toUWriteUChars | final static CoderResult toUWriteUChars(CharsetDecoderICU cnv, char[] ucharsArray, int ucharsBegin, int length, CharBuffer target, IntBuffer offsets, int sourceIndex)(Code) | | ONLY used by ToU callback functions.
This function will write out the specified characters to the target
character buffer.
A CoderResult object that contains the error result when an error occurs. |
toUnicodeWithCallback | final CoderResult toUnicodeWithCallback(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush)(Code) | | |
|
|