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 Constructor (Byte[], Int32, Int32, Boolean)

Initializes a new MemoryStream based on the specified region of a byte array with the CanWrite property set as specified.

[Visual Basic]
Overloads Public Sub New( _
   ByVal buffer() As Byte, _
   ByVal index As Integer, _
   ByVal count As Integer, _
   ByVal writeable As Boolean _
)
[C#]
public MemoryStream(
   byte[] buffer,
   int index,
   int count,
   bool writeable
);
[C++]
public: MemoryStream(
   unsigned char* buffer[],
   int index,
   int count,
   bool writeable
);
[JScript]
public function MemoryStream(
   buffer : Byte[],
   index : int,
   count : int,
   writeable : Boolean
);

Parameters

buffer
The array of unsigned bytes from which to create this stream.
index
The index into buffer at which the stream begins.
count
The length of the stream in bytes.
writeable
A flag designating whether the stream supports writing. This argument sets the CanWrite property.

Exceptions

Exception Type Condition
ArgumentNullException buffer is null.
ArgumentOutOfRangeException index or count are negative.
ArgumentException index and count describe an invalid range in buffer.

Remarks

The CanRead and CanSeek properties are both set to true.

The length of the stream cannot be set to a value greater than the initial length of the specified byte array; however, the stream can be truncated (see SetLength).

See Also

MemoryStream Class | MemoryStream Members | System.IO Namespace | MemoryStream Constructor Overload List