• Home
  • API Documentation
Show / Hide Table of Contents
  • McStreamy
    • ByteArrayExtensions
      • ToStream
    • NonClosingStreamAdapter
      • CanRead
      • CanSeek
      • CanTimeout
      • CanWrite
      • Dispose
      • Flush
      • Length
      • NonClosingStreamAdapter
      • Position
      • Read
      • ReadByte
      • ReadTimeout
      • Seek
      • SetLength
      • ToString
      • Write
      • WriteByte
      • WriteTimeout
    • StreamExtensions
      • ReadAllBytes
      • ReadAllBytesAsync
      • ReadAsString
      • ReadAsStringAsync
      • WriteAllBytes
      • WriteAllBytesAsync
    • StringExtensions
      • ToStream

Class NonClosingStreamAdapter

NonClosingStreamAdapter wraps an existing stream instance and passes through all calls except for Dispose(Boolean), which is ignored. This is useful when you must pass a stream to another component that insists on closing the stream under various conditions, but you want to retain access to the stream after you're done with that component.

Inheritance
System.Object
NonClosingStreamAdapter
Namespace: McStreamy
Assembly: cs.temp.dll.dll
Syntax
public class NonClosingStreamAdapter : Stream

Constructors

Name Description
NonClosingStreamAdapter(Stream)

Initializes a new instance of the NonClosingStreamAdapter class wrapping the provided stream instance.

Properties

Name Description
CanRead

Returns the System.IO.Stream.CanRead value from the wrapped stream.

CanSeek

Returns the System.IO.Stream.CanSeek value from the wrapped stream.

CanTimeout

Returns the System.IO.Stream.CanTimeout value from the wrapped stream.

CanWrite

Returns the System.IO.Stream.CanWrite value from the wrapped stream.

Length

Returns the System.IO.Stream.Length value from the wrapped stream.

Position

Sets or returns the System.IO.Stream.Position value on the wrapped stream, representing the current position within the stream.

ReadTimeout

Sets or returns the System.IO.Stream.ReadTimeout value on the wrapped stream.

WriteTimeout

Sets or returns the System.IO.Stream.WriteTimeout value on the wrapped stream.

Methods

Name Description
Dispose(Boolean)

Calls System.IO.Stream.Flush on the underlying stream but does not dispose it.

Flush()

Calls System.IO.Stream.Flush on the wrapped stream.

Read(Byte[], Int32, Int32)

Calls the System.IO.Stream.Read(System.Byte[],System.Int32,System.Int32) method on the wrapped stream.

ReadByte()

Calls ReadByte() on the wrapped stream.

Seek(Int64, SeekOrigin)

Calls the System.IO.Stream.Seek(System.Int64,System.IO.SeekOrigin) method on the wrapped stream.

SetLength(Int64)

Calls the System.IO.Stream.SetLength(System.Int64) method on the wrapped stream.

ToString()

Calls System.Object.ToString() on the wrapped stream.

Write(Byte[], Int32, Int32)

Calls the System.IO.Stream.Write(System.Byte[],System.Int32,System.Int32) method on the wrapped stream.

WriteByte(Byte)

Calls WriteByte(Byte) on the wrapped stream.

See Also

System.IO.Stream
Back to top Copyright (c) 2017 Troy Willmot