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!

Encoder.GetByteCount

Returns the number of bytes that the next call to GetBytes will produce if presented with the specified range of characters, when implemented by a subclass.

[Visual Basic]
MustOverride Public Function GetByteCount( _
   ByVal chars() As Char, _
   ByVal index As Integer, _
   ByVal count As Integer, _
   ByVal flush As Boolean _
) As Integer
[C#]
public abstract int GetByteCount(
   char[] chars,
   int index,
   int count,
   bool flush
);
[C++]
public: virtual int GetByteCount(
   __wchar_t* chars[],
   int index,
   int count,
   bool flush
) = 0;
[JScript]
public abstract function GetByteCount(
   chars : Char[],
   index : int,
   count : int,
   flush : Boolean
) : int;

Parameters

chars
The character array to encode.
index
The starting index of the character array to encode.
count
The number of characters to encode.
flush
true if the encoder should flush its internal state following the conversion; otherwise, false.

Return Value

The number of bytes the next call to Encoder.GetBytes will produce if presented with the specified range of characters and the specified value of flush.

The returned value takes into account the state in which the encoder was left following the last call to Encoder.GetBytes.

Exceptions

Exception Type Condition
ArgumentNullException If chars is a null reference (in Visual Basic Nothing).
ArgumentOutOfRangeException If index and count do not denote a valid range in the character array.

Remarks

The state of the encoder is not affected by a call to this method.

See Also

Encoder Class | Encoder Members | System.Text Namespace