Export (0) Print
Expand All

Encoding.GetBytes Method (Char[], Int32, Int32)

.NET Framework 1.1

Encodes a range of characters from a character array into a byte array.

[Visual Basic]
Overloads Public Overridable Function GetBytes( _
   ByVal chars() As Char, _
   ByVal index As Integer, _
   ByVal count As Integer _
) As Byte()
[C#]
public virtual byte[] GetBytes(
 char[] chars,
 int index,
 int count
);
[C++]
public: virtual unsigned char GetBytes(
 __wchar_t chars __gc[],
 int index,
 int count
)  __gc[];
[JScript]
public function GetBytes(
   chars : Char[],
 index : int,
 count : int
) : Byte[];

Parameters

chars
The character array to encode.
index
The starting index of the character array to encode.
count
The number of characters to encode.

Return Value

A byte array containing the encoded representation of the specified range of characters in chars.

Exceptions

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

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 | Encoding.GetBytes Overload List | GetByteCount | GetMaxByteCount | GetDecoder | GetEncoder

Show:
© 2014 Microsoft