XmlWriter.WriteBase64 Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

When overridden in a derived class, encodes the specified binary bytes as Base64 and writes out the resulting text.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

Syntax

'Declaration
Public MustOverride Sub WriteBase64 ( _
    buffer As Byte(), _
    index As Integer, _
    count As Integer _
)
public abstract void WriteBase64(
    byte[] buffer,
    int index,
    int count
)

Parameters

  • buffer
    Type: array<System.Byte[]
    Byte array to encode.
  • index
    Type: System.Int32
    The position in the buffer indicating the start of the bytes to write.

Exceptions

Exception Condition
ArgumentNullException

buffer is nulla null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

index or count is less than zero.

-or-

The buffer length minus index is less than count.

Remarks

For example, the byte buffer may contain the binary contents of a GIF image. This clearly would not be valid XML. The Base64 encoding is designed to represent arbitrary byte sequences in a text form comprised of the 65 US-ASCII characters ([A-Za-z0-9+/=]) where each character encodes 6 bits of the binary data. For more information, see Requests for Comments (RFC) 1521 located on the Request for Comments Web site at http://www.rfc-editor.org/.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.