System.Xml.XmlTextReader.ReadBase64 Method

Decodes Base64 and returns the decoded binary bytes.

Syntax

public int ReadBase64 (byte[] array, int offset, int len)

Parameters

offset
The zero-based index into the array specifying where the method can begin to write to the buffer.
array
The array of characters that serves as the buffer to which the text contents are written.
offset
The zero-based index into the array specifying where the method can begin to write to the buffer.
len
The number of bytes to write into the buffer.

Returns

The number of bytes written to the buffer.

Exceptions

TypeReason
ArgumentNullException array is null.
ArgumentOutOfRangeException

offset < 0, or len < 0.

- or -

len > array.Length - offset.

System.Xml.XmlExceptionThe Base64 sequence is not valid.

Remarks

Note:

In the dnprdnext release, the recommended practice is to create System.Xml.XmlReader instances using the erload:System.Xml.XmlReader.Create method. This allows you to take full advantage of the new features introduced in this release. For more information, see Creating XML Readers.

Like XmlTextReader.ReadChars(Char[], int, int), this method can be called successively to read large streams of embedded text. It decodes Base64 content and returns the decoded binary bytes (for example, an inline Base64 encoded GIF image) into the buffer. See RFC 1521. (You can obtain RFCs from the Request for Comments Web site at http://www.rfc-editor.org)

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0