Skip to content

CargoStream Class

Wraps a source stream and carries additional items that are disposed when the stream is closed.

MethodDescription
Close()Closes the source stream and also closes the additional objects that are carried.
Flush()Flushes the source stream.
Read(buffer, offset, count)Reads from the source stream.
Seek(offset, origin)Changes the position of the source stream.
SetLength(value)Sets the length of the source stream.
Write(buffer, offset, count)Writes to the source stream.
PropertyDescription
CanReadGets a value indicating whether the source stream supports reading.
CanSeekGets a value indicating whether the source stream supports seeking.
CanWriteGets a value indicating whether the source stream supports writing.
CargoGets the list of additional items that are disposed when the stream is closed. The order of the list is the order in which the items are disposed. The contents can be modified any time.
LengthGets the length of the source stream.
PositionGets or sets the position of the source stream.
SourceGets the source stream of the cargo stream.
WixToolset.Dtf.Compression.dll version 5.0.0+41e11442b2ca93e444b60213b5ae99dcbab787d8

Closes the source stream and also closes the additional objects that are carried.

public void Close()

Flushes the source stream.

public void Flush()

Reads from the source stream.

public int Read(
System.Byte[] buffer,
int offset,
int count
)
ParameterTypeDescription
bufferSystem.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 source.
offsetintThe zero-based byte offset in buffer at which to begin storing the data read from the stream.
countintThe maximum number of bytes to be read from the stream.

int 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.

Changes the position of the source stream.

public System.Int64 Seek(
System.Int64 offset,
System.IO.SeekOrigin origin
)
ParameterTypeDescription
offsetSystem.Int64A byte offset relative to the origin parameter.
originSystem.IO.SeekOriginA value of type SeekOrigin indicating the reference point used to obtain the new position.

System.Int64 The new position within the stream.

Sets the length of the source stream.

public void SetLength(
System.Int64 value
)
ParameterTypeDescription
valueSystem.Int64The desired length of the stream in bytes.

Writes to the source stream.

public void Write(
System.Byte[] buffer,
int offset,
int count
)
ParameterTypeDescription
bufferSystem.Byte[]An array of bytes. This method copies count bytes from buffer to the stream.
offsetintThe zero-based byte offset in buffer at which to begin copying bytes to the stream.
countintThe number of bytes to be written to the stream.

Gets a value indicating whether the source stream supports reading.

public bool CanRead { get; set; }

Gets a value indicating whether the source stream supports seeking.

public bool CanSeek { get; set; }

Gets a value indicating whether the source stream supports writing.

public bool CanWrite { get; set; }

Gets the list of additional items that are disposed when the stream is closed. The order of the list is the order in which the items are disposed. The contents can be modified any time.

public IList<System.IDisposable> Cargo { get; set; }

Gets the length of the source stream.

public System.Int64 Length { get; set; }

Gets or sets the position of the source stream.

public System.Int64 Position { get; set; }

Gets the source stream of the cargo stream.

public System.IO.Stream Source { get; set; }