NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

StreamWriter.Write (Char[], Int32, Int32)

Writes a subarray of characters to the text stream.

[Visual Basic]
Overloads Overrides Public Sub Write( _
   ByVal buffer() As Char, _
   ByVal index As Integer, _
   ByVal count As Integer _
)
[C#]
public override void Write(
   char[] buffer,
   int index,
   int count
);
[C++]
public: override void Write(
   __wchar_t* buffer[],
   int index,
   int count
);
[JScript]
public override function Write(
   buffer : Char[],
   index : int,
   count : int
);

Parameters

buffer
The character array from which data is read.
index
The index into buffer at which to begin reading.
count
The number of characters to read from buffer.

Exceptions

Exception Type Condition
ArgumentNullException buffer is a null reference (in Visual Basic Nothing).
ArgumentException The buffer length minus index is less than count.
ArgumentOutOfRangeException index or count is negative.
IOException An I/O error occurs.

Remarks

StreamReader.Read (char[], int,

int) and StreamWriter.Write (char[], int, int) read and write the number of characters specified by the count parameter, while Stream.Read and Stream.Write read and write the number of bytes specified by the count parameter. Use the Stream methods only for reading and writing an integral number of byte arrays.

The characters are read from buffer beginning at index and ending at index + count. All characters are written to the underlying stream unless the end of the underlying stream is reached prematurely. Flush is invoked automatically if AutoFlush is true.

See Also

StreamWriter Class | StreamWriter Members | System.IO Namespace | StreamWriter.Write Overload List