Export (0) Print
Expand All

Encoding.GetMaxCharCount Method

When overridden in a derived class, returns the maximum number of characters produced by decoding a given number of bytes.

[Visual Basic]
Public MustOverride Function GetMaxCharCount( _
   ByVal byteCount As Integer _
) As Integer
[C#]
public abstract int GetMaxCharCount(
 int byteCount
);
[C++]
public: virtual int GetMaxCharCount(
 int byteCount
) = 0;
[JScript]
public abstract function GetMaxCharCount(
   byteCount : int
) : int;

Parameters

byteCount
The number of bytes to encode.

Return Value

The maximum number of characters produced by decoding a specified number of bytes.

Remarks

This method can be used to determine an appropriate buffer size for character arrays passed to GetChars or a Decoder 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.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Encoding Class | Encoding Members | System.Text Namespace

Show:
© 2014 Microsoft