Encoding.GetMaxByteCount メソッド
派生クラスでオーバーライドされた場合は、指定した文字数をエンコードするために必要な最大バイト数を返します。
Public MustOverride Function GetMaxByteCount( _
ByVal charCount As Integer _) As Integer
[C#]
public abstract int GetMaxByteCount(intcharCount);
[C++]
public: virtual int GetMaxByteCount(intcharCount) = 0;
[JScript]
public abstract function GetMaxByteCount(
charCount : int) : int;
パラメータ
- charCount
エンコードする文字数。
戻り値
指定した文字数をエンコードするために必要な最大バイト数。
解説
GetMaxByteCount を使用すると、このエンコーディングの GetBytes に渡された、バイト配列の適切なバッファ サイズを確認できます。
このメソッドの結果に従ってバッファのサイズが設定された場合は、すべてのエンコーディングでバッファ オーバーフローによる例外は発生しません。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET, Common Language Infrastructure (CLI) Standard