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!

BufferedStream.Write

Copies bytes to the buffered stream and advances the current position within the buffered stream by the number of bytes written.

[Visual Basic]
Overrides Public Function Write( _
   ByVal array() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer _
) As Integer
[C#]
public override int Write(
   byte[] array,
   int offset,
   int count
);
[C++]
public: override int Write(
   unsigned char* array[],
   int offset,
   int count
);
[JScript]
public override function Write(
   array : Byte[],
   offset : int,
   count : int
) : int;

Parameters

array
An array whose elements are of type Byte, SByte, Char, Int16, Int32, Int64, Single, or Double. This method copies count bytes from array to the current buffered stream.
offset
The byte offset in the buffer at which to begin copying bytes to the current buffered stream.
count
The number of bytes to be written to the current buffered stream.

Return Value

The number of bytes written to the stream.

Exceptions

Exception Type Condition
ArgumentException Length of array minus offset is less than count.
ArgumentNullException array is null.
ArgumentOutOfRangeException offset or count is less than zero.
IOException The stream is closed or null.
NotSupportedException The stream does not support writing.

Remarks

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

See Also

BufferedStream Class | BufferedStream Members | System.IO Namespace | CanWrite | Read