Table of Contents

Class IgnoreDisposeStream

Namespace
NAudio.Utils
Assembly
NAudio.Core.dll

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

public class IgnoreDisposeStream : Stream, IDisposable, IAsyncDisposable
Inheritance
IgnoreDisposeStream
Implements
Inherited Members

Constructors

IgnoreDisposeStream(Stream)

Creates a new IgnoreDisposeStream

public IgnoreDisposeStream(Stream sourceStream)

Parameters

sourceStream Stream

The source stream

Properties

CanRead

Can Read

public override bool CanRead { get; }

Property Value

bool

CanSeek

Can Seek

public override bool CanSeek { get; }

Property Value

bool

CanWrite

Can write to the underlying stream

public override bool CanWrite { get; }

Property Value

bool

IgnoreDispose

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

public bool IgnoreDispose { get; set; }

Property Value

bool

Length

Gets the length of the underlying stream

public override long Length { get; }

Property Value

long

Position

Gets or sets the position of the underlying stream

public override long Position { get; set; }

Property Value

long

SourceStream

The source stream all other methods fall through to

public Stream SourceStream { get; }

Property Value

Stream

Methods

Dispose(bool)

Dispose - by default (IgnoreDispose = true) will do nothing, leaving the underlying stream undisposed

protected override void Dispose(bool disposing)

Parameters

disposing bool

Flush()

Flushes the underlying stream

public override void Flush()

Read(byte[], int, int)

Reads from the underlying stream

public override int Read(byte[] buffer, int offset, int count)

Parameters

buffer byte[]
offset int
count int

Returns

int

Seek(long, SeekOrigin)

Seeks on the underlying stream

public override long Seek(long offset, SeekOrigin origin)

Parameters

offset long
origin SeekOrigin

Returns

long

SetLength(long)

Sets the length of the underlying stream

public override void SetLength(long value)

Parameters

value long

Write(byte[], int, int)

Writes to the underlying stream

public override void Write(byte[] buffer, int offset, int count)

Parameters

buffer byte[]
offset int
count int