APIdia Launch Partner
Top Fields Constructors Methods
sun.nio.cs

pack-priv abstract Class UnicodeDecoder

extends CharsetDecoder
Class Inheritance
Known Direct Subclasses
sun.nio.cs.UTF_16.Decoder, sun.nio.cs.UTF_16BE.Decoder, sun.nio.cs.UTF_16LE.Decoder, sun.nio.cs.UTF_16LE_BOM.Decoder
Imports
java.nio.ByteBuffer, .CharBuffer, java.nio.charset.Charset, .CharsetDecoder, .CoderResult, .CharacterCodingException, .MalformedInputException

Field Summary

Modifier and TypeField and Description
protected static final int
protected static final char
private int
private int
private final int
protected static final int
protected static final int
protected static final char

Constructor Summary

AccessConstructor and Description
public
UnicodeDecoder(Charset cs, int bo)

public
UnicodeDecoder(Charset cs, int bo, int defaultBO)

Method Summary

Modifier and TypeMethod and Description
private char
decode(int b1, int b2)

protected CoderResult
decodeLoop(ByteBuffer src, CharBuffer dst)

Implements abstract java.nio.charset.CharsetDecoder.decodeLoop.

Decodes one or more bytes into one or more characters.

protected void
implReset()

Overrides java.nio.charset.CharsetDecoder.implReset.

Resets this decoder, clearing any charset-specific internal state.

Inherited from java.nio.charset.CharsetDecoder:
averageCharsPerBytecharsetdecodedecodedetectedCharsetflushimplFlushimplOnMalformedInputimplOnUnmappableCharacterimplReplaceWithisAutoDetectingisCharsetDetectedmalformedInputActionmaxCharsPerByteonMalformedInputonUnmappableCharacterreplacementreplaceWithresetunmappableCharacterAction

Field Detail

BIGback to summary
protected static final int BIG
BYTE_ORDER_MARKback to summary
protected static final char BYTE_ORDER_MARK
currentByteOrderback to summary
private int currentByteOrder
defaultByteOrderback to summary
private int defaultByteOrder
expectedByteOrderback to summary
private final int expectedByteOrder
LITTLEback to summary
protected static final int LITTLE
NONEback to summary
protected static final int NONE
REVERSED_MARKback to summary
protected static final char REVERSED_MARK

Constructor Detail

UnicodeDecoderback to summary
public UnicodeDecoder(Charset cs, int bo)
UnicodeDecoderback to summary
public UnicodeDecoder(Charset cs, int bo, int defaultBO)

Method Detail

decodeback to summary
private char decode(int b1, int b2)
decodeLoopback to summary
protected CoderResult decodeLoop(ByteBuffer src, CharBuffer dst)

Implements abstract java.nio.charset.CharsetDecoder.decodeLoop.

Doc from java.nio.charset.CharsetDecoder.decodeLoop.

Decodes one or more bytes into one or more characters.

This method encapsulates the basic decoding loop, decoding as many bytes as possible until it either runs out of input, runs out of room in the output buffer, or encounters a decoding error. This method is invoked by the decode method, which handles result interpretation and error recovery.

The buffers are read from, and written to, starting at their current positions. At most in.remaining() bytes will be read, and at most out.remaining() characters will be written. The buffers' positions will be advanced to reflect the bytes read and the characters written, but their marks and limits will not be modified.

This method returns a CoderResult object to describe its reason for termination, in the same manner as the decode method. Most implementations of this method will handle decoding errors by returning an appropriate result object for interpretation by the decode method. An optimized implementation may instead examine the relevant error action and implement that action itself.

An implementation of this method may perform arbitrary lookahead by returning CoderResult#UNDERFLOW until it receives sufficient input.

implResetback to summary
protected void implReset()

Overrides java.nio.charset.CharsetDecoder.implReset.

Doc from java.nio.charset.CharsetDecoder.implReset.

Resets this decoder, clearing any charset-specific internal state.

The default implementation of this method does nothing. This method should be overridden by decoders that maintain internal state.