Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

XmlWriter.WriteBase64 Method

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

[Visual Basic]
Public MustOverride Sub WriteBase64( _
   ByVal buffer() As Byte, _
   ByVal index As Integer, _
   ByVal count As Integer _
)
[C#]
public abstract void WriteBase64(
 byte[] buffer,
 int index,
 int count
);
[C++]
public: virtual void WriteBase64(
 unsigned char buffer __gc[],
 int index,
 int count
) = 0;
[JScript]
public abstract function WriteBase64(
   buffer : Byte[],
 index : int,
 count : int
);

Parameters

buffer
Byte array to encode.
index
The position in the buffer indicating the start of the bytes to write.
count
The number of bytes to write.

Exceptions

Exception Type Condition
ArgumentNullException buffer is a null reference (Nothing in Visual Basic).
ArgumentException The buffer length minus index is less than count.
ArgumentOutOfRangeException index or count is less than zero.

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/ .

Example

See XmlTextWriter.WriteBase64 for an example using this method.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

XmlWriter Class | XmlWriter Members | System.Xml Namespace

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.