C# Class IronPigeon.Substream

Wraps an underlying stream with another that has a shorter length so that folks reading cannot read to the end.
The parent stream should not be repositioned while the substream is in use.
Inheritance: Stream
ファイルを表示 Open project: AArnott/IronPigeon

Public Methods

Method Description
Flush ( ) : void
FlushAsync ( CancellationToken cancellationToken ) : Task
Read ( byte buffer, int offset, int count ) : int
ReadAsync ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : Task
ReadByte ( ) : int
Seek ( long offset, SeekOrigin origin ) : long
SetLength ( long value ) : void
Substream ( Stream underlyingStream, long length ) : System

Initializes a new instance of the Substream class.

Write ( byte buffer, int offset, int count ) : void
WriteAsync ( byte buffer, int offset, int count, System cancellationToken ) : Task
WriteByte ( byte value ) : void

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Method Details

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

Flush() public method

public Flush ( ) : void
return void

FlushAsync() public method

public FlushAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
return Task

Read() public method

public Read ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
return int

ReadAsync() public method

public ReadAsync ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : Task
buffer byte
offset int
count int
cancellationToken System.Threading.CancellationToken
return Task

ReadByte() public method

public ReadByte ( ) : int
return int

Seek() public method

public Seek ( long offset, SeekOrigin origin ) : long
offset long
origin SeekOrigin
return long

SetLength() public method

public SetLength ( long value ) : void
value long
return void

Substream() public method

Initializes a new instance of the Substream class.
public Substream ( Stream underlyingStream, long length ) : System
underlyingStream Stream The stream to wrap.
length long The length of the stream to expose in this wrapper.
return System

Write() public method

public Write ( byte buffer, int offset, int count ) : void
buffer byte
offset int
count int
return void

WriteAsync() public method

public WriteAsync ( byte buffer, int offset, int count, System cancellationToken ) : Task
buffer byte
offset int
count int
cancellationToken System
return Task

WriteByte() public method

public WriteByte ( byte value ) : void
value byte
return void