Search Results for

    Show / Hide Table of Contents

    Class AutoResetStream

    Decorates a Stream instance to support auto-rewind after read/write access.

    Inheritance
    Object
    MarshalByRefObject
    Stream
    AutoResetStream
    Implements
    IDisposable
    Inherited Members
    Stream.Null
    Stream.BeginRead(Byte[], Int32, Int32, AsyncCallback, Object)
    Stream.BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object)
    Stream.CopyTo(Stream)
    Stream.CopyTo(Stream, Int32)
    Stream.CopyToAsync(Stream)
    Stream.CopyToAsync(Stream, Int32)
    Stream.CreateWaitHandle()
    Stream.Dispose()
    Stream.EndRead(IAsyncResult)
    Stream.EndWrite(IAsyncResult)
    Stream.FlushAsync()
    Stream.ObjectInvariant()
    Stream.ReadAsync(Byte[], Int32, Int32)
    Stream.Synchronized(Stream)
    Stream.WriteAsync(Byte[], Int32, Int32)
    MarshalByRefObject.GetLifetimeService()
    MarshalByRefObject.InitializeLifetimeService()
    MarshalByRefObject.MemberwiseClone(Boolean)
    Object.Equals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Namespace: BionicCode.Utilities.Net
    Assembly: BionicCode.Utilities.Net.Common.dll
    Syntax
    public class AutoResetStream : Stream, IDisposable

    Constructors

    | Improve this Doc View Source

    AutoResetStream()

    Default constructor. Creates an instance where the BaseStream is set to a MemoryStream.

    Declaration
    public AutoResetStream()
    | Improve this Doc View Source

    AutoResetStream(Stream)

    Constructor which accepts the Stream instance to decorate in order to extend its behavior.

    Declaration
    public AutoResetStream(Stream baseStream)
    Parameters
    Type Name Description
    Stream baseStream

    The Stream instance to decorate in order to extend its behavior.

    | Improve this Doc View Source

    AutoResetStream(Stream, Boolean)

    Constructor which accepts the Stream instance to decorate in order to extend its behavior.

    Declaration
    public AutoResetStream(Stream baseStream, bool leaveDecoratedStreamOpen)
    Parameters
    Type Name Description
    Stream baseStream

    The Stream instance to decorate in order to extend its behavior.

    Boolean leaveDecoratedStreamOpen

    When set to true the decorated underlying Stream will be disposed or closed too, if the AutoResetStream is disposed or closed.

    | Improve this Doc View Source

    AutoResetStream(Stream, SeekOrigin, Boolean)

    Constructor which accepts the Stream instance to decorate in order to extend its behavior.

    Declaration
    public AutoResetStream(Stream baseStream, SeekOrigin resetOrigin, bool leaveDecoratedStreamOpen)
    Parameters
    Type Name Description
    Stream baseStream

    The Stream instance to decorate in order to extend its behavior.

    SeekOrigin resetOrigin

    The origin to which the stream should be reset to.

    Boolean leaveDecoratedStreamOpen

    When set to true the decorated underlying Stream will be disposed or closed too, if the AutoResetStream is disposed or closed.

    Properties

    | Improve this Doc View Source

    BaseStream

    The decorated Stream instance which will be extended.

    Declaration
    public Stream BaseStream { get; set; }
    Property Value
    Type Description
    Stream

    An instance of type Stream. This instance will be decorated to extend the default Stream features and behaviors.

    | Improve this Doc View Source

    CanRead

    Declaration
    public override bool CanRead { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    Stream.CanRead
    | Improve this Doc View Source

    CanSeek

    Declaration
    public override bool CanSeek { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    Stream.CanSeek
    | Improve this Doc View Source

    CanTimeout

    Declaration
    public override bool CanTimeout { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    Stream.CanTimeout
    | Improve this Doc View Source

    CanWrite

    Declaration
    public override bool CanWrite { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    Stream.CanWrite
    | Improve this Doc View Source

    IsDisposingDecoratedStream

    Gets whether the decorated underlying Stream will be closed or disposed when the AutoResetStream instance is closed or disposed. Use constructor to set the value in order to configure the behavior.

    Declaration
    public bool IsDisposingDecoratedStream { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Length

    Declaration
    public override long Length { get; }
    Property Value
    Type Description
    Int64
    Overrides
    Stream.Length
    | Improve this Doc View Source

    Position

    Declaration
    public override long Position { get; set; }
    Property Value
    Type Description
    Int64
    Overrides
    Stream.Position
    | Improve this Doc View Source

    ReadTimeout

    Declaration
    public override int ReadTimeout { get; set; }
    Property Value
    Type Description
    Int32
    Overrides
    Stream.ReadTimeout
    | Improve this Doc View Source

    ResetOrigin

    Defines the position to which the stream should reset to.

    Declaration
    public SeekOrigin ResetOrigin { get; set; }
    Property Value
    Type Description
    SeekOrigin

    A SeekOrigin value.

    | Improve this Doc View Source

    WriteTimeout

    Declaration
    public override int WriteTimeout { get; set; }
    Property Value
    Type Description
    Int32
    Overrides
    Stream.WriteTimeout

    Methods

    | Improve this Doc View Source

    Close()

    Declaration
    public override void Close()
    Overrides
    Stream.Close()
    | Improve this Doc View Source

    CopyToAsync(Stream, Int32, CancellationToken)

    Declaration
    public override async Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Stream destination
    Int32 bufferSize
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    Overrides
    Stream.CopyToAsync(Stream, Int32, CancellationToken)
    | Improve this Doc View Source

    Dispose(Boolean)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing
    Overrides
    Stream.Dispose(Boolean)
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    Object.Equals(Object)
    | Improve this Doc View Source

    Flush()

    Declaration
    public override void Flush()
    Overrides
    Stream.Flush()
    | Improve this Doc View Source

    FlushAsync(CancellationToken)

    Declaration
    public override Task FlushAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    Overrides
    Stream.FlushAsync(CancellationToken)
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    Object.GetHashCode()
    | Improve this Doc View Source

    Read(Byte[], Int32, Int32)

    Declaration
    public override int Read(byte[] buffer, int offset, int count)
    Parameters
    Type Name Description
    Byte[] buffer
    Int32 offset
    Int32 count
    Returns
    Type Description
    Int32
    Overrides
    Stream.Read(Byte[], Int32, Int32)
    | Improve this Doc View Source

    ReadAsync(Byte[], Int32, Int32, CancellationToken)

    Declaration
    public override async Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Byte[] buffer
    Int32 offset
    Int32 count
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<Int32>
    Overrides
    Stream.ReadAsync(Byte[], Int32, Int32, CancellationToken)
    | Improve this Doc View Source

    ReadByte()

    Declaration
    public override int ReadByte()
    Returns
    Type Description
    Int32
    Overrides
    Stream.ReadByte()
    | Improve this Doc View Source

    Reset(SeekOrigin)

    Resets the Position to an offset of '0' relative to the provided seekOrigin.

    Declaration
    public void Reset(SeekOrigin seekOrigin = SeekOrigin.Current)
    Parameters
    Type Name Description
    SeekOrigin seekOrigin

    The optional relative position of the Stream to apply the zero offset to. The default is Begin.

    | Improve this Doc View Source

    Seek(Int64, SeekOrigin)

    Declaration
    public override long Seek(long offset, SeekOrigin origin)
    Parameters
    Type Name Description
    Int64 offset
    SeekOrigin origin
    Returns
    Type Description
    Int64
    Overrides
    Stream.Seek(Int64, SeekOrigin)
    | Improve this Doc View Source

    SetLength(Int64)

    Declaration
    public override void SetLength(long value)
    Parameters
    Type Name Description
    Int64 value
    Overrides
    Stream.SetLength(Int64)
    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Object.ToString()
    | Improve this Doc View Source

    Write(Byte[], Int32, Int32)

    Declaration
    public override void Write(byte[] buffer, int offset, int count)
    Parameters
    Type Name Description
    Byte[] buffer
    Int32 offset
    Int32 count
    Overrides
    Stream.Write(Byte[], Int32, Int32)
    | Improve this Doc View Source

    WriteAsync(Byte[], Int32, Int32, CancellationToken)

    Declaration
    public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Byte[] buffer
    Int32 offset
    Int32 count
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    Overrides
    Stream.WriteAsync(Byte[], Int32, Int32, CancellationToken)
    | Improve this Doc View Source

    WriteByte(Byte)

    Declaration
    public override void WriteByte(byte value)
    Parameters
    Type Name Description
    Byte value
    Overrides
    Stream.WriteByte(Byte)

    Implements

    IDisposable

    Extension Methods

    HelperExtensionsCommon.ToDictionary(Object)
    HelperExtensionsCommon.ToFlatDictionary(Object)
    HelperExtensionsCommon.HasReachedEnd(Stream)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX