NanoByte.Common  2.9.0
NanoByte.Common.Streams.ExtraDisposeStream Class Reference

Decorator that executes an additional delegate before Stream.Dispose(). More...

Inheritance diagram for NanoByte.Common.Streams.ExtraDisposeStream:
NanoByte.Common.Streams.DelegatingStream

Public Member Functions

 ExtraDisposeStream (Stream underlyingStream, Action disposeHandler)
 Creates a new dispose wrapper stream. More...
 
- Public Member Functions inherited from NanoByte.Common.Streams.DelegatingStream
override void Flush ()
 
override long Seek (long offset, SeekOrigin origin)
 
override void SetLength (long value)
 
override int Read (byte[] buffer, int offset, int count)
 
override void Write (byte[] buffer, int offset, int count)
 
override Task FlushAsync (CancellationToken cancellationToken)
 
override Task< int > ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 
override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 
override int Read (Span< byte > buffer)
 
override ValueTask< int > ReadAsync (Memory< byte > buffer, CancellationToken cancellationToken=default)
 
override void Write (ReadOnlySpan< byte > buffer)
 
override ValueTask WriteAsync (ReadOnlyMemory< byte > buffer, CancellationToken cancellationToken=default)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from NanoByte.Common.Streams.DelegatingStream
 DelegatingStream (Stream underlyingStream)
 Creates a new delegating stream. More...
 
override void Dispose (bool disposing)
 

Additional Inherited Members

- Protected Attributes inherited from NanoByte.Common.Streams.DelegatingStream
readonly Stream UnderlyingStream
 Underlying stream to delegate to. More...
 
- Properties inherited from NanoByte.Common.Streams.DelegatingStream
override bool CanRead [get]
 
override bool CanSeek [get]
 
override bool CanWrite [get]
 
override long Length [get]
 
override bool CanTimeout [get]
 
override int ReadTimeout [get]
 
override int WriteTimeout [get]
 
override long Position [get, set]
 

Detailed Description

Decorator that executes an additional delegate before Stream.Dispose().

Constructor & Destructor Documentation

◆ ExtraDisposeStream()

NanoByte.Common.Streams.ExtraDisposeStream.ExtraDisposeStream ( Stream  underlyingStream,
Action  disposeHandler 
)
inline

Creates a new dispose wrapper stream.

Parameters
underlyingStreamUnderlying stream to delegate to. Will be disposed together with this stream.
disposeHandlerExecuted before underlyingStream is disposed.

The documentation for this class was generated from the following file: