Table of Contents

Class StreamContainer

Namespace
Aspose.CAD
Assembly
Aspose.CAD.dll

Represents stream container which contains the stream and provides stream processing routines.

public class StreamContainer : DisposableObject, IDisposable
Inheritance
StreamContainer
Implements
Derived
Inherited Members

Constructors

StreamContainer(Stream)

Initializes a new instance of the StreamContainer class.

StreamContainer(Stream, bool)

Initializes a new instance of the StreamContainer class.

Fields

ReadWriteBytesCount

Specifies read and write bytes count when reading sequentially.

StartPosition

The starting position inside the stream.

Properties

CanRead

Gets a value indicating whether stream supports reading.

CanSeek

Gets a value indicating whether stream supports seeking.

CanWrite

Gets a value indicating whether stream supports writing.

IsStreamDisposedOnClose

Gets a value indicating whether this stream is disposed on close.

Length

Gets or sets the stream length in bytes. This value is less than the Length by the starting stream position passed in the StreamContainer constructor.

Position

Gets or sets the current position within the stream. This value represents offset from the starting stream position passed in the StreamContainer constructor.

Stream

Gets the data stream.

SyncRoot

Gets an object that can be used to synchronize access to the synchronized resource.

Methods

AfterStreamDisposed()

Called after the stream is disposed.

BeforeSave(Stream)

Called before save occurs on the destination stream.

BeforeStreamDisposed()

Called before the stream is disposed.

DisposeStream()

Disposes the stream.

Flush()

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.

Read(byte[])

Reads bytes to fill the specified bytes buffer.

Read(byte[], int, int)

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

ReadByte()

Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.

ReleaseManagedResources()

Releases the managed resources. Make sure no unmanaged resources are released here, since they may have been already released.

Save(Stream)

Saves (copies) the stream's data to the specified stream. Uses default buffer size ReadWriteBytesCount and stream Length value.

Save(Stream, int)

Saves (copies) all the stream's data to the specified stream. Uses stream Length value.

Save(Stream, int, long)

Saves (copies) the stream's data to the specified stream.

Save(string)

Saves (copies) the stream's data to the specified stream. Uses default buffer size ReadWriteBytesCount and stream Length value.

Save(string, int)

Saves (copies) the stream's data to the specified stream. Uses stream Length value.

Save(string, int, long)

Saves (copies) the stream's data to the specified stream.

Seek(long, SeekOrigin)

Sets the position within the current stream.

SeekBegin()

Sets the stream position to the beginning of the stream. This value represents offset from the starting stream position passed in the StreamContainer constructor.

ToBytes()

Converts the stream data to the byte array.

ToBytes(long, long)

Converts the stream data to the byte array.

Write(byte[])

Writes all of the specified bytes to the stream.

Write(byte[], int, int)

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

WriteByte(byte)

Writes a byte to the current position in the stream and advances the position within the stream by one byte.

WriteTo(StreamContainer)

Copies the contained data to another StreamContainer.

WriteTo(StreamContainer, long)

Copies the contained data to another StreamContainer.

Operators

explicit operator Stream(StreamContainer)

Performs an explicit conversion from StreamContainer to Stream.