UnicodeEncoding: GetBytesEx |
Encodes a set of characters into an array of bytes, returning the number of bytes produced.
Public Function GetBytesEx( ByRef Chars As Variant, ByVal CharIndex As Long, ByVal CharCount As Long, ByRef Bytes ( ) As Byte, ByVal ByteIndex As Long ) As Long
The Bytes array cannot be null and must be large enough to hold the encoded set of characters. To obtain the size required, use GetByteCount to find the necessary size. Or, use GetMaxByteCount to get the largest size that could be produced. The largest size is not the perfect size, only the maximum number of bytes that could ever be produced by a number of characters. Resizing of the resultant Bytes array may be necessary.