SmartMemory Management

SmartMemoryStream.Write Method 

Writes the content of the buffer into the buffer of the stream.

[Visual Basic]
Overrides Public Sub Write( _
   ByVal buffer As Byte(), _
   ByVal offset As Integer, _
   ByVal count As Integer _
)
[C#]
public override void Write(
   byte[] buffer,
   int offset,
   int count
);

Parameters

buffer
The buffer with the data to be copied to this stream.
offset
The offset in the source buffer
count
The number of bytes to read.

Remarks

If the capacity of the current _Buffer is exceeded, a new buffer is aquired from the BufferProvider. The new buffer has at least a size of (Capacity + count)*2. The obsolete old buffer is recycled by the BufferProvider if its capacity exceeds the MinimumRequiredSize

If you know how big the stream will grow in advance, it's a good idea to call SetLength before writing to the stream. Otherwise, a great deal of memory might be wasted because the size of the underlying buffer must be increased several times.

See Also

SmartMemoryStream Class | InfiniTec.SystemUtilities Namespace