NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

UnicodeEncoding.GetMaxByteCount

Returns the maximum number of bytes required to encode a given number of characters.

[Visual Basic]
Overrides Public Function GetMaxByteCount( _
   ByVal charCount As Integer _
) As Integer
[C#]
public override int GetMaxByteCount(
   int charCount
);
[C++]
public: override int GetMaxByteCount(
   int charCount
);
[JScript]
public override function GetMaxByteCount(
   charCount : int
) : int;

Parameters

charCount
The number of characters to encode.

Return Value

The maximum number of bytes required to encode a given number of characters.

Remarks

This method can be used to determine an appropriate buffer size for byte arrays passed to GetBytes or GetBytes for this encoding. All encoding must guarantee that no buffer overflow exceptions will occur if buffers are sized according to the results of this method.

See Also

UnicodeEncoding Class | UnicodeEncoding Members | System.Text Namespace | GetBytes | GetBytes