Class TrackableStream
A stream that can wrap any System.IO.Stream that exposes events when the stream is closing and closed.
Inheritance
System.Object
TrackableStream
Assembly: EPiServer.Framework.dll
Version: 12.0.3
Syntax
public class TrackableStream : Stream
Constructors
TrackableStream(Stream)
Declaration
public TrackableStream(Stream stream)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
The stream that should be wrapped and tracked
|
Properties
CanRead
Declaration
public override bool CanRead { get; }
Property Value
Type |
Description |
System.Boolean |
|
CanSeek
Declaration
public override bool CanSeek { get; }
Property Value
Type |
Description |
System.Boolean |
|
CanWrite
Declaration
public override bool CanWrite { get; }
Property Value
Type |
Description |
System.Boolean |
|
InnerStream
Gets the System.IO.Stream that is tracked using this class.
Declaration
public virtual Stream InnerStream { get; }
Property Value
Type |
Description |
System.IO.Stream |
|
Length
Declaration
public override long Length { get; }
Property Value
Type |
Description |
System.Int64 |
|
Position
Declaration
public override long Position { get; set; }
Property Value
Type |
Description |
System.Int64 |
|
Methods
Close()
Declaration
public override void Close()
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
System.Boolean |
disposing |
|
Flush()
Declaration
public override void Flush()
Read(Byte[], Int32, Int32)
Declaration
public override int Read(byte[] buffer, int offset, int count)
Parameters
Type |
Name |
Description |
System.Byte[] |
buffer |
|
System.Int32 |
offset |
|
System.Int32 |
count |
|
Returns
Type |
Description |
System.Int32 |
|
Seek(Int64, SeekOrigin)
Declaration
public override long Seek(long offset, SeekOrigin origin)
Parameters
Type |
Name |
Description |
System.Int64 |
offset |
|
System.IO.SeekOrigin |
origin |
|
Returns
Type |
Description |
System.Int64 |
|
SetLength(Int64)
Declaration
public override void SetLength(long value)
Parameters
Type |
Name |
Description |
System.Int64 |
value |
|
Write(Byte[], Int32, Int32)
Declaration
public override void Write(byte[] buffer, int offset, int count)
Parameters
Type |
Name |
Description |
System.Byte[] |
buffer |
|
System.Int32 |
offset |
|
System.Int32 |
count |
|
Events
Closed
Called after the stream is closed
Declaration
public event EventHandler<EventArgs> Closed
Event Type
Type |
Description |
System.EventHandler<System.EventArgs> |
|
Closing
Called before the stream is closed
Declaration
public event EventHandler<EventArgs> Closing
Event Type
Type |
Description |
System.EventHandler<System.EventArgs> |
|
Extension Methods