CargoStream Class
Wraps a source stream and carries additional items that are disposed when the stream is closed.
Methods
Method | Description |
---|---|
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. |
Properties
Property | Description |
---|---|
CanRead | Gets a value indicating whether the source stream supports reading. |
CanSeek | Gets a value indicating whether the source stream supports seeking. |
CanWrite | Gets a value indicating whether the source stream supports writing. |
Cargo | 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. |
Length | Gets the length of the source stream. |
Position | Gets or sets the position of the source stream. |
Source | Gets the source stream of the cargo stream. |
WixToolset.Dtf.Compression.dll
version 5.0.2+aa65968c419420d32e3e1b647aea0082f5ca5b78
Close() Method
Closes the source stream and also closes the additional objects that are carried.
Declaration
public void Close()
Flush() Method
Flushes the source stream.
Declaration
public void Flush()
Read(buffer, offset, count) Method
Reads from the source stream.
Declaration
public int Read(
System.Byte[] buffer,
int offset,
int count
)
Parameters
Parameter | Type | Description |
---|---|---|
buffer | System.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. |
offset | int | The zero-based byte offset in buffer at which to begin storing the data read from the stream. |
count | int | The maximum number of bytes to be read from the stream. |
Return value
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.
Seek(offset, origin) Method
Changes the position of the source stream.
Declaration
public System.Int64 Seek(
System.Int64 offset,
System.IO.SeekOrigin origin
)
Parameters
Parameter | Type | Description |
---|---|---|
offset | System.Int64 | A byte offset relative to the origin parameter. |
origin | System.IO.SeekOrigin | A value of type SeekOrigin indicating the reference point used to obtain the new position. |
Return value
System.Int64
The new position within the stream.
SetLength(value) Method
Sets the length of the source stream.
Declaration
public void SetLength(
System.Int64 value
)
Parameters
Parameter | Type | Description |
---|---|---|
value | System.Int64 | The desired length of the stream in bytes. |
Write(buffer, offset, count) Method
Writes to the source stream.
Declaration
public void Write(
System.Byte[] buffer,
int offset,
int count
)
Parameters
Parameter | Type | Description |
---|---|---|
buffer | System.Byte[] | An array of bytes. This method copies count bytes from buffer to the stream. |
offset | int | The zero-based byte offset in buffer at which to begin copying bytes to the stream. |
count | int | The number of bytes to be written to the stream. |
CanRead Property
Gets a value indicating whether the source stream supports reading.
Declaration
public bool CanRead { get; set; }
CanSeek Property
Gets a value indicating whether the source stream supports seeking.
Declaration
public bool CanSeek { get; set; }
CanWrite Property
Gets a value indicating whether the source stream supports writing.
Declaration
public bool CanWrite { get; set; }
Cargo Property
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.
Declaration
public IList<System.IDisposable> Cargo { get; set; }
Length Property
Gets the length of the source stream.
Declaration
public System.Int64 Length { get; set; }
Position Property
Gets or sets the position of the source stream.
Declaration
public System.Int64 Position { get; set; }
Source Property
Gets the source stream of the cargo stream.
Declaration
public System.IO.Stream Source { get; set; }