Table of Contents

Class HandlerContent

Namespace
NexusRpc.Handlers
Assembly
NexusRpc.dll

Content that can be used in a handler. Can be streaming or fixed set of bytes.

public class HandlerContent
Inheritance
HandlerContent
Inherited Members

Constructors

HandlerContent(byte[], IReadOnlyDictionary<string, string>?)

Initializes a new instance of the HandlerContent class from a fixed set of bytes.

public HandlerContent(byte[] bytes, IReadOnlyDictionary<string, string>? headers = null)

Parameters

bytes byte[]

Byte array.

headers IReadOnlyDictionary<string, string>

Headers if any.

HandlerContent(Stream, IReadOnlyDictionary<string, string>?)

Initializes a new instance of the HandlerContent class from a stream.

public HandlerContent(Stream stream, IReadOnlyDictionary<string, string>? headers = null)

Parameters

stream Stream

Byte stream.

headers IReadOnlyDictionary<string, string>

Headers if any.

Properties

Headers

Gets the headers on this content if any.

public IReadOnlyDictionary<string, string>? Headers { get; }

Property Value

IReadOnlyDictionary<string, string>

Methods

ConsumeAllBytes()

Consume all bytes as a byte array. Once this has been called, it cannot be called again.

public byte[] ConsumeAllBytes()

Returns

byte[]

All bytes.

Exceptions

InvalidOperationException

Already consumed.

ConsumeStream()

Take the stream off this content for consumption. Once this has been called, it cannot be called again.

public Stream ConsumeStream()

Returns

Stream

Stream.

Exceptions

InvalidOperationException

Already consumed.