GetBytes Method (String, Int32, Int32, Byte[], Int32)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

When overridden in a derived class, encodes a set of characters from the specified string into the specified byte array.

Namespace:  System.Text
Assembly:  mscorlib (in mscorlib.dll)

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


Type: System..::..String
The string containing the set of characters to encode.
Type: System..::..Int32
The index of the first character to encode.
Type: System..::..Int32
The number of characters to encode.
Type: array<System..::..Byte>[]()[][]
The byte array to contain the resulting sequence of bytes.
Type: System..::..Int32
The index at which to start writing the resulting sequence of bytes.

Return Value

Type: System..::..Int32
The actual number of bytes written into bytes.

If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, the application should use the Decoder or the Encoder provided by the GetDecoder method or the GetEncoder method, respectively, of a derived class.