Decoder: GetChars |
Returns the decoded unicode characters from a block of bytes.
Public Function GetChars( ByRef Bytes ( ) As Byte, ByVal ByteIndex As Long, ByVal ByteCount As Long, ByRef Chars ( ) As Integer, ByVal CharIndex As Long, Optional ByVal Flush As Boolean ) As Long
GetChars converts an array of bytes into Unicode characters. Since Unicode characters could span a boundry between calls the method will store any state needed to resume converting characters in the next call. This allows for unknown chunks of data to be to converted without needed to enure each chunk contains complete characters. A typical scenario would be streaming data from a network.
Because there is state stored between calls, the caller must inform the method that the last chunk of data is being processed so the method can correctly account for any state that might have persisted. This is achieved by passing True for the Flush parameter.