Xeno-rat
Loading...
Searching...
No Matches
NAudio.Utils.IgnoreDisposeStream Class Reference

Pass-through stream that ignores Dispose Useful for dealing with MemoryStreams that you want to re-use. More...

Inheritance diagram for NAudio.Utils.IgnoreDisposeStream:
Collaboration diagram for NAudio.Utils.IgnoreDisposeStream:

Public Member Functions

 IgnoreDisposeStream (Stream sourceStream)
 Creates a new IgnoreDisposeStream.
 
override void Flush ()
 Flushes the underlying stream.
 
override int Read (byte[] buffer, int offset, int count)
 Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
 
override long Seek (long offset, SeekOrigin origin)
 Sets the position within the current stream.
 
override void SetLength (long value)
 Sets the length of the current stream.
 
override void Write (byte[] buffer, int offset, int count)
 Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
 

Protected Member Functions

override void Dispose (bool disposing)
 Disposes of the underlying source stream if disposing is true and IgnoreDispose is false.
 

Properties

Stream SourceStream [get, private set]
 The source stream all other methods fall through to.
 
bool IgnoreDispose [get, set]
 If true the Dispose will be ignored, if false, will pass through to the SourceStream Set to true by default.
 
override bool CanRead [get]
 Can Read.
 
override bool CanSeek [get]
 Can Seek.
 
override bool CanWrite [get]
 Can write to the underlying stream.
 
override long Length [get]
 Gets the length of the underlying stream.
 
override long Position [get, set]
 Gets or sets the position of the underlying stream.
 

Detailed Description

Pass-through stream that ignores Dispose Useful for dealing with MemoryStreams that you want to re-use.

Constructor & Destructor Documentation

◆ IgnoreDisposeStream()

NAudio.Utils.IgnoreDisposeStream.IgnoreDisposeStream ( Stream sourceStream)
inline

Creates a new IgnoreDisposeStream.

Parameters
sourceStreamThe source stream

Member Function Documentation

◆ Dispose()

override void NAudio.Utils.IgnoreDisposeStream.Dispose ( bool disposing)
inlineprotected

Disposes of the underlying source stream if disposing is true and IgnoreDispose is false.

Parameters
disposingA System.Boolean value indicating whether the method is being called from user code (true) or from a finalizer (false).
Exceptions
ObjectDisposedExceptionThrown if the method is called after the source stream has been disposed.

◆ Flush()

override void NAudio.Utils.IgnoreDisposeStream.Flush ( )
inline

Flushes the underlying stream.

This method flushes the underlying stream, writing any buffered data to the underlying file or network.

◆ Read()

override int NAudio.Utils.IgnoreDisposeStream.Read ( byte[] buffer,
int offset,
int count )
inline

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Parameters
bufferAn 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.
offsetThe zero-based byte offset in buffer at which to begin storing the data read from the current stream.
countThe maximum number of bytes to be read from the current stream.
Returns
The total number of bytes read into the buffer. This might be less than the number of bytes requested if that many bytes are not currently available, or zero if the end of the stream is reached.

◆ Seek()

override long NAudio.Utils.IgnoreDisposeStream.Seek ( long offset,
SeekOrigin origin )
inline

Sets the position within the current stream.

Parameters
offsetA byte offset relative to the origin parameter.
originA value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position.
Returns
The new position within the current stream.

◆ SetLength()

override void NAudio.Utils.IgnoreDisposeStream.SetLength ( long value)
inline

Sets the length of the current stream.

Parameters
valueThe desired length of the current stream in bytes.
Exceptions
System.IO.IOExceptionAn I/O error occurs.

◆ Write()

override void NAudio.Utils.IgnoreDisposeStream.Write ( byte[] buffer,
int offset,
int count )
inline

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

Parameters
bufferAn array of bytes. This method copies count bytes from buffer to the current stream.
offsetThe zero-based byte offset in buffer at which to begin copying bytes to the current stream.
countThe number of bytes to be written to the current stream.
Exceptions
System.ArgumentNullExceptionThrown when buffer is null.
System.ArgumentOutOfRangeExceptionThrown when offset or count is negative.

Property Documentation

◆ CanRead

override bool NAudio.Utils.IgnoreDisposeStream.CanRead
get

Can Read.

◆ CanSeek

override bool NAudio.Utils.IgnoreDisposeStream.CanSeek
get

Can Seek.

◆ CanWrite

override bool NAudio.Utils.IgnoreDisposeStream.CanWrite
get

Can write to the underlying stream.

◆ IgnoreDispose

bool NAudio.Utils.IgnoreDisposeStream.IgnoreDispose
getset

If true the Dispose will be ignored, if false, will pass through to the SourceStream Set to true by default.

◆ Length

override long NAudio.Utils.IgnoreDisposeStream.Length
get

Gets the length of the underlying stream.

◆ Position

override long NAudio.Utils.IgnoreDisposeStream.Position
getset

Gets or sets the position of the underlying stream.

◆ SourceStream

Stream NAudio.Utils.IgnoreDisposeStream.SourceStream
getprivate set

The source stream all other methods fall through to.


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