com.ibm.icu.charset

Class CharsetDecoderICU

public abstract class CharsetDecoderICU extends CharsetDecoder

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.

UNKNOWN: ICU 3.6 This API might change or be removed in a future release.

Method Summary
protected CoderResultdecodeLoop(ByteBuffer in, CharBuffer out)
Decodes one or more bytes.
protected CoderResultimplFlush(CharBuffer out)
Flushes any characters saved in the converter's internal buffer and resets the converter.
protected voidimplOnMalformedInput(CodingErrorAction newAction)
Sets the action to be taken if an illegal sequence is encountered
protected voidimplOnUnmappableCharacter(CodingErrorAction newAction)
Sets the action to be taken if an illegal sequence is encountered
protected voidimplReset()
Resets the to Unicode mode of converter

Method Detail

decodeLoop

protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out)
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 out buffer to populate with decoded result

Returns: Result of decoding action. Returns CoderResult.UNDERFLOW if the decoding action succeeds or more input is needed for completing the decoding action.

UNKNOWN: ICU 3.6

implFlush

protected final CoderResult implFlush(CharBuffer out)
Flushes any characters saved in the converter's internal buffer and resets the converter.

Parameters: out action to be taken

Returns: result of flushing action and completes the decoding all input. Returns CoderResult.UNDERFLOW if the action succeeds.

UNKNOWN: ICU 3.6

implOnMalformedInput

protected final void implOnMalformedInput(CodingErrorAction newAction)
Sets the action to be taken if an illegal sequence is encountered

Parameters: newAction action to be taken

Throws: IllegalArgumentException

UNKNOWN: ICU 3.6

implOnUnmappableCharacter

protected final void implOnUnmappableCharacter(CodingErrorAction newAction)
Sets the action to be taken if an illegal sequence is encountered

Parameters: newAction action to be taken

Throws: IllegalArgumentException

UNKNOWN: ICU 3.6

implReset

protected void implReset()
Resets the to Unicode mode of converter

UNKNOWN: ICU 3.6

Copyright (c) 2007 IBM Corporation and others.