UnicodeEncoding: GetDecoder

GetDecoder

Returns a decoder that maintains state.



 Public Function GetDecoder ( ) As Decoder

Return Values

Decoder -  The stateful decoder.

Remarks

Unlike UnicodeEncoding, the decoder maintains state between decoding calls. Since a single unicode character required exactly 2 bytes to be decoded, it is possible that an odd number of bytes may be attempted to be decoding, creating an orphaned byte which represents only half of a unicode character. The remaining byte is held until the next decoding call, and the byte is then inserted at the beginning of the next set of bytes to be decoded, picking up byte decoding where the orphaned byte left off.

See Also

Project CorLib Overview

Class UnicodeEncoding Overview