Table of Contents

Class PipeReaderExtensions

Namespace
IceRpc.Slice.Operations
Assembly
IceRpc.Slice.dll

Provides extension methods for PipeReader.

public static class PipeReaderExtensions
Inheritance
PipeReaderExtensions
Inherited Members

Methods

ToAsyncStream<T>(PipeReader, DecodeFunc<T>, ISliceProxy?, ISliceFeature?)

Creates an async stream over a pipe reader to decode variable size streamed elements.

public static IAsyncStream<T> ToAsyncStream<T>(this PipeReader reader, DecodeFunc<T> decodeFunc, ISliceProxy? sender = null, ISliceFeature? sliceFeature = null)

Parameters

reader PipeReader

The pipe reader.

decodeFunc DecodeFunc<T>

The function used to decode the streamed member.

sender ISliceProxy

The proxy that sent the request, if applicable.

sliceFeature ISliceFeature

The slice feature to customize the decoding.

Returns

IAsyncStream<T>

The async stream to decode and return the streamed members.

Type Parameters

T

The stream element type.

Remarks

The reader ownership is transferred to the returned async stream. The caller should no longer use the reader after this call, and must dispose the returned async stream when done to release the reader.

ToAsyncStream<T>(PipeReader, DecodeFunc<T>, int, ISliceFeature?)

Creates an async stream over a pipe reader to decode streamed elements.

public static IAsyncStream<T> ToAsyncStream<T>(this PipeReader reader, DecodeFunc<T> decodeFunc, int elementSize, ISliceFeature? sliceFeature = null)

Parameters

reader PipeReader

The pipe reader.

decodeFunc DecodeFunc<T>

The function used to decode the streamed member.

elementSize int

The size in bytes of one element.

sliceFeature ISliceFeature

The Slice feature to customize the decoding.

Returns

IAsyncStream<T>

The async stream to decode and return the streamed elements.

Type Parameters

T

The type of the element being decoded.

Remarks

The reader ownership is transferred to the returned async stream. The caller should no longer use the reader after this call, and must dispose the returned async stream when done to release the reader.

Exceptions

ArgumentException

Thrown if elementSize is equal of inferior to 0.