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

System.Text.Encoding.GetBytes Method

Encodes the specified range of the specified string into the specified range of the specified byte array. [Edit]

public virtual int GetBytes (string s, int charIndex, int charCount, byte[] bytes, int byteIndex)

Parameters

s
A string to encode. [Edit]
charIndex
A int containing the first index of s from which to encode. [Edit]
charCount
A int containing the number of characters of s to encode. [Edit]
bytes
The byte array to encode into. [Edit]
byteIndex
A int containing the first index of bytes to encode into. [Edit]
s
Documentation for this section has not yet been entered. [Edit]
charIndex
Documentation for this section has not yet been entered. [Edit]
bytes
Documentation for this section has not yet been entered. [Edit]
byteIndex
Documentation for this section has not yet been entered. [Edit]

Returns

A int containing the number of bytes encoded into bytes. [Edit]

Exceptions

TypeReason
ArgumentExceptionbytes does not contain sufficient space to store the encoded characters. [Edit]
ArgumentNullException

s is null.

-or-

bytes is null.

[Edit]
ArgumentOutOfRangeException

charIndex < 0.

-or-

charCount < 0.

-or-

byteIndex < 0.

-or-

(s.Length - charIndex) < charCount.

-or-

byteIndex >= bytes.Length.

[Edit]

Remarks

Operation
As described above.

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

[Edit]

Requirements

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