Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Encoding.GetMaxByteCount Method

When overridden in a derived class, returns the maximum number of bytes required to encode a given number of characters.

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

Parameters

charCount
The number of characters to encode.

Return Value

The maximum number of bytes required for encoding a given number of characters.

Remarks

GetMaxByteCount can be used to determine an appropriate buffer size for byte arrays passed to the GetBytes of 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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.