AwaitableStream AwaitableStream Class

Definition

Meant to be used with CopyToAsync for bufferless reads

public class AwaitableStream : Stream, IDisposable
Public Class AwaitableStream
    Inherits Stream
    Implements IDisposable
Inheritance
AwaitableStreamAwaitableStream
Implements

Properties

CanRead CanRead

public override bool CanRead { get; }
Public Overrides ReadOnly Property CanRead As Boolean
Overrides

CanSeek CanSeek

public override bool CanSeek { get; }
Public Overrides ReadOnly Property CanSeek As Boolean
Overrides

CanWrite CanWrite

public override bool CanWrite { get; }
Public Overrides ReadOnly Property CanWrite As Boolean
Overrides

Completion Completion

public Task Completion { get; }
Public ReadOnly Property Completion As Task
Value
Task Task

Length Length

public override long Length { get; }
Public Overrides ReadOnly Property Length As Long
Value
Int64 Int64
Overrides

Position Position

public override long Position { get; set; }
Public Overrides Property Position As Long
Value
Int64 Int64
Overrides

Methods

Cancel() Cancel()

public void Cancel()
Public Sub Cancel

CanTimeout CanTimeout

Inherited from Stream

Consumed(Int32) Consumed(Int32)

Tell the awaitable stream how many bytes were consumed. This needs to be called from the continuation.

public void Consumed(int count)
Public Sub Consumed(count As Integer)
Parameters
count
Int32 Int32

Number of bytes consumed by the continuation

CopyTo(Stream) CopyTo(Stream)

Inherited from Stream

CopyTo(Stream, Int32) CopyTo(Stream, Int32)

Inherited from Stream

CopyToAsync(Stream) CopyToAsync(Stream)

Inherited from Stream

CopyToAsync(Stream, Int32) CopyToAsync(Stream, Int32)

Inherited from Stream

CopyToAsync(Stream, Int32, CancellationToken) CopyToAsync(Stream, Int32, CancellationToken)

Inherited from Stream

AwaitableStream AwaitableStream

Inherited from Stream

Dispose() Dispose()

Inherited from Stream

Dispose(Boolean) Dispose(Boolean)

protected override void Dispose(bool disposing)
Protected Overrides Sub Dispose(disposing As Boolean)
Parameters
disposing
Boolean Boolean
Overrides

Equals(Object) Equals(Object)

Inherited from Object

Equals(Object, Object) Equals(Object, Object)

Inherited from Object

Flush() Flush()

public override void Flush()
Public Overrides Sub Flush
Overrides

FlushAsync() FlushAsync()

Inherited from Stream

FlushAsync(CancellationToken) FlushAsync(CancellationToken)

Inherited from Stream

GetHashCode() GetHashCode()

Inherited from Object

GetType() GetType()

Inherited from Object

MemberwiseClone() MemberwiseClone()

Inherited from Object

Read(Byte[], Int32, Int32) Read(Byte(), Int32, Int32)

public override int Read(byte[] buffer, int offset, int count)
Public Overrides Function Read(buffer As Byte(), offset As Integer, count As Integer) As Integer
Parameters
buffer
Byte[] Byte()
offset
Int32 Int32
count
Int32 Int32
Returns
Overrides

ReadAsync() ReadAsync()

public StreamAwaitable ReadAsync()
Public Function ReadAsync As StreamAwaitable
Returns

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

Inherited from Stream

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

Inherited from Stream

ReadByte() ReadByte()

Inherited from Stream

ReadTimeout ReadTimeout

Inherited from Stream

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from Object

Seek(Int64, SeekOrigin) Seek(Int64, SeekOrigin)

public override long Seek(long offset, SeekOrigin origin)
Public Overrides Function Seek(offset As Long, origin As SeekOrigin) As Long
Parameters
offset
Int64 Int64
Returns
Overrides

SetLength(Int64) SetLength(Int64)

public override void SetLength(long value)
Public Overrides Sub SetLength(value As Long)
Parameters
value
Int64 Int64
Overrides

ToString() ToString()

Inherited from Object

Write(Byte[], Int32, Int32) Write(Byte(), Int32, Int32)

public override void Write(byte[] buffer, int offset, int count)
Public Overrides Sub Write(buffer As Byte(), offset As Integer, count As Integer)
Parameters
buffer
Byte[] Byte()
offset
Int32 Int32
count
Int32 Int32
Overrides

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

Inherited from Stream

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

public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Public Overrides Function WriteAsync(buffer As Byte(), offset As Integer, count As Integer, cancellationToken As CancellationToken) As Task
Parameters
buffer
Byte[] Byte()
offset
Int32 Int32
count
Int32 Int32
Returns
Overrides

WriteByte(Byte) WriteByte(Byte)

Inherited from Stream

WriteTimeout WriteTimeout

Inherited from Stream