Version

GetByteCount Method

When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters from the specified character array.
Syntax
'Declaration
 
Function GetByteCount( _
   ByVal chars() As Char, _
   ByVal index As Integer, _
   ByVal count As Integer _
) As Integer
int GetByteCount( 
   char[] chars,
   int index,
   int count
)

Parameters

chars
The character array containing the set of characters to encode.
index
The zero-based Index of the first character to encode.
count
The number of characters to encode.

Return Value

The number of bytes produced by encoding the specified characters.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionchars is null.
System.ArgumentOutOfRangeExceptionindex or count is less than zero.-or- index and count do not denote a valid range in chars.
System.Text.EncoderFallbackExceptionA fallback occurred (see Understanding Encodings for complete explanation).
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also