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!

MemoryStream.Write

Writes a block of bytes to the current stream using data read from buffer.

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

Parameters

buffer
The buffer to write data to.
offset
The byte offset in buffer at which to begin writing.
count
The maximum number of bytes to write.

Return Value

The number of bytes written.

Exceptions

Exception Type Condition
ArgumentNullException buffer is null.
NotSupportedException The stream does not support writing.
ArgumentException offset subtracted from the buffer length is less than count.
ArgumentOutOfRangeException offset or count are negative.

Remarks

The offset parameter gives the offset of the first byte in buffer to write from, and the count parameter gives the number of bytes to write. If the write operation is successful, the current position within the stream is advanced by the number of bytes written. If an exception occurs, the current position within the stream is unchanged.

See Also

MemoryStream Class | MemoryStream Members | System.IO Namespace