Mono Class Library: System.Text.Encoding Overview | Members

System.Text.Encoding.GetBytes Method

Encodes the specified range of the specified char array.

public virtual byte[] GetBytes (char[] chars, int index, int count)

Parameters

chars
The char array to encode.
index
A int containing the first index of chars to encode.
count
A int containing the number of characters to encode.

Returns

A byte array containing the encoded representation of the range in chars from index to index + count - 1.

Exceptions

TypeReason
ArgumentNullExceptionchars is null.
ArgumentOutOfRangeExceptionindex and count do not denote a valid range in chars.

Remarks

Operation
As described above.

Note to Inheritors
This method is overridden by types derived from System.Text.Encoding to perform the encoding.

Requirements

Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0