Decoder: GetCharCount

GetCharCount

Returns the number of characters a block of bytes can produce.



 Public Function GetCharCount(
	  ByRef Bytes ( ) As Byte,
	  ByVal Index As Long,
	  ByVal Count As Long,
	  Optional ByVal Flush As Boolean ) As Long

Parameters

Bytes
[ByRef] Byte. The bytes to be used in decoding to characters.
Index
[ByVal] Long. The starting index in Bytes to begin decoding from.
Count
[ByVal] Long. The number of bytes to be used in the decoding process.
Flush
[ByVal] Optional. Boolean. Tells the Decoder to clear any state after the call.

Return Values

Long -  The number of characters that can be produced from Count number of bytes.

Remarks

GetCharCount itself does not store state between method calls, but it will use any stored state from a previous call to GetChars. Typically you would call this method immediately before calling GetChars.

Call with Flush equals True when then last chunk of data is being processed. This will ensure any characters that would normally have been stored as state for the next call will be processed during this call. No state is ever stored by this method, but any hanging characters need to be processed instead of being ignored.

See Also

Project CorLib Overview

Class Decoder Overview