Class SplitStreamContainer
Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.8.0)
Represents split stream container which contains the stream and provides stream processing routines.
public class SplitStreamContainer : StreamContainer, IDisposableInheritance
object ← DisposableObject ← StreamContainer ← SplitStreamContainer
Implements
Inherited Members
StreamContainer.ReadWriteBytesCount , StreamContainer.startPosition , StreamContainer.Flush() , StreamContainer.Write(byte[]) , StreamContainer.WriteByte(byte) , StreamContainer.Read(byte[]) , StreamContainer.ToBytes() , StreamContainer.ToBytes(long, long) , StreamContainer.Read(byte[], int, int) , StreamContainer.ReadByte() , StreamContainer.Seek(long, SeekOrigin) , StreamContainer.SeekBegin() , StreamContainer.Write(byte[], int, int) , StreamContainer.Save(Stream) , StreamContainer.Save(Stream, int) , StreamContainer.Save(Stream, int, long) , StreamContainer.Save(string) , StreamContainer.Save(string, int) , StreamContainer.Save(string, int, long) , StreamContainer.WriteTo(StreamContainer) , StreamContainer.WriteTo(StreamContainer, long) , StreamContainer.AfterStreamDisposed() , StreamContainer.BeforeStreamDisposed() , StreamContainer.BeforeSave(Stream) , StreamContainer.ReleaseManagedResources() , StreamContainer.DisposeStream() , StreamContainer.SyncRoot , StreamContainer.Position , StreamContainer.Stream , StreamContainer.IsStreamDisposedOnClose , StreamContainer.Length , StreamContainer.CanRead , StreamContainer.CanSeek , StreamContainer.CanWrite , DisposableObject.Dispose() , DisposableObject.ReleaseManagedResources() , DisposableObject.ReleaseUnmanagedResources() , DisposableObject.VerifyNotDisposed() , DisposableObject.Disposed , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
SplitStreamContainer(Stream)
Initializes a new instance of the Aspose.Imaging.SplitStreamContainer class.
public SplitStreamContainer(Stream stream)Parameters
stream Stream
The stream.
SplitStreamContainer(Stream, bool)
Initializes a new instance of the Aspose.Imaging.SplitStreamContainer class.
public SplitStreamContainer(Stream stream, bool disposeStream)Parameters
stream Stream
The data stream.
disposeStream bool
if set to true the stream will be disposed when container is disposed.
SplitStreamContainer(StreamContainer, bool)
Initializes a new instance of the Aspose.Imaging.SplitStreamContainer class.
public SplitStreamContainer(StreamContainer stream, bool disposeStream)Parameters
stream StreamContainer
The stream container.
disposeStream bool
if set to true disposes stream.
Properties
CanRead
Gets a value indicating whether stream supports reading.
public override bool CanRead { get; }Property Value
CanSeek
Gets a value indicating whether stream supports seeking.
public override bool CanSeek { get; }Property Value
CanWrite
Gets a value indicating whether stream supports writing.
public override bool CanWrite { get; }Property Value
Length
Gets or sets the stream length in bytes. This value is less than the System.IO.Stream.Length by the starting stream position passed in the StreamContainer constructor.
public override long Length { get; set; }Property Value
Position
Gets or sets the current position within the stream. This value represents offset from the starting stream position passed in the StreamContainer constructor.
public override long Position { get; set; }Property Value
Stream
Gets the data stream.
public override Stream Stream { get; }Property Value
SyncRoot
Gets an object that can be used to synchronize access to the synchronized resource.
public object SyncRoot { get; }Property Value
Methods
DisposeStream()
Disposes the stream.
protected override void DisposeStream()Flush()
Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
public override void Flush()Insert(int, StreamContainer, bool)
Inserts the stream container into specified position.
public void Insert(int position, StreamContainer stream, bool disposeStream)Parameters
position int
The position to insert to.
stream StreamContainer
The stream container to insert.
disposeStream bool
if set to true disposes stream.
Exceptions
Framework exception
Read(byte[])
Reads bytes to fill the specified bytes buffer.
public override int Read(byte[] bytes)Parameters
bytes byte
[]
The bytes to fill.
Returns
The number of bytes read. This value can be less than the number of bytes in the buffer if there is not enough bytes in the stream.
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.
public override int Read(byte[] buffer, int offset, int count)Parameters
buffer byte
[]
An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.
offset int
The zero-based byte offset in buffer at which to begin storing the data read from the current stream.
count int
The maximum number of bytes to be read from the current stream.
Returns
The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.
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.
public override int ReadByte()Returns
The unsigned byte cast to an Int32, or -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.
protected override void ReleaseManagedResources()Save(Stream, int, long)
Saves (copies) the stream’s data to the specified stream.
public override void Save(Stream destinationStream, int bufferSize, long length)Parameters
destinationStream Stream
The stream to save the data to.
bufferSize int
The buffer size.
length long
The stream data length to copy. By default the length is set to Aspose.Imaging.SplitStreamContainer.Length value.
Seek(long, SeekOrigin)
Sets the position within the current stream.
public override long Seek(long offset, SeekOrigin origin)Parameters
offset long
A byte offset relative to the origin parameter. This value represents offset from the starting stream position passed in the StreamContainer constructor.
origin SeekOrigin
A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position.
Returns
The new 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.
public override void SeekBegin()ToBytes()
Converts the stream data to the System.Byte array.
public override byte[] ToBytes()Returns
byte []
The stream data converted to the System.Byte array.
ToBytes(long, long)
Converts the stream data to the System.Byte array.
public override byte[] ToBytes(long position, long bytesCount)Parameters
position long
The position to start reading bytes from.
bytesCount long
The bytes count to read.
Returns
byte []
The stream data converted to the System.Byte array.
Write(byte[])
Writes all of the specified bytes to the stream.
public override void Write(byte[] bytes)Parameters
bytes byte
[]
The bytes to write.
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.
public override void Write(byte[] buffer, int offset, int count)Parameters
buffer byte
[]
An array of bytes. This method copies count bytes from buffer to the current stream.
offset int
The zero-based byte offset in buffer at which to begin copying bytes to the current stream.
count int
The number of bytes to be written to the current stream.
WriteByte(byte)
Writes a byte to the current position in the stream and advances the position within the stream by one byte.
public override void WriteByte(byte value)Parameters
value byte
The byte to write to the stream.