PayloadStream Class

Definition

An extension of Stream that operates in conjunction with a PayloadStreamAssembler to convert raw bytes into a consumable form.

public class PayloadStream : System.IO.Stream
type PayloadStream = class
    inherit Stream
Public Class PayloadStream
Inherits Stream
Inheritance
PayloadStream

Constructors

PayloadStream(PayloadStreamAssembler)

Initializes a new instance of the PayloadStream class.

Properties

CanRead

When overridden in a derived class, gets a value indicating whether the current stream supports reading.

CanSeek

When overridden in a derived class, gets a value indicating whether the current stream supports seeking.

CanWrite

When overridden in a derived class, gets a value indicating whether the current stream supports writing.

Length

When overridden in a derived class, gets the length in bytes of the stream.

Position

When overridden in a derived class, gets or sets the position within the current stream.

Methods

Cancel()

Closes the connected PayloadStreamAssembler and ends production.

Dispose(Boolean)
DoneProducing()

Called when production is cancelled or completed.

Flush()

No-op. PayloadStreams should never be flushed, so we override Stream's Flush to make sure no caller attempts to flush a PayloadStream.

Read(Byte[], Int32, Int32)

This function is called by StreamReader when processing streams. It will appear to have no references, but is in fact required to be implemented by StreamReader, just like Length.

ReadAsync(Byte[], Int32, Int32, CancellationToken)
Seek(Int64, SeekOrigin)

Not supported. Throws NotSupportedException.

SetLength(Int64)

Not supported. Throws NotSupportedException.

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

Applies to