A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://dotnet.github.io/dotNext/api/DotNext.IO.DataTransferObject.html below:

Class DataTransferObject | .NEXT

Class DataTransferObject

Various extension methods for IDataTransferObject.

Inheritance

DataTransferObject

Namespace: DotNext.IO Assembly: DotNext.IO.dll Syntax
public static class DataTransferObject
Methods | Edit this page View Source ToByteArrayAsync<TObject>(TObject, MemoryAllocator<byte>?, CancellationToken)

Converts DTO to an array of bytes.

Declaration
public static ValueTask<byte[]> ToByteArrayAsync<TObject>(this TObject dto, MemoryAllocator<byte>? allocator = null, CancellationToken token = default) where TObject : IDataTransferObject
Parameters Type Name Description TObject dto

Data transfer object to read from.

MemoryAllocator<byte> allocator

The memory allocator.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns Type Parameters Name Description TObject

The type of data transfer object.

Exceptions | Edit this page View Source ToMemoryAsync<TObject>(TObject, MemoryAllocator<byte>?, CancellationToken)

Converts DTO to a block of memory.

Declaration
public static ValueTask<MemoryOwner<byte>> ToMemoryAsync<TObject>(this TObject dto, MemoryAllocator<byte>? allocator = null, CancellationToken token = default) where TObject : IDataTransferObject
Parameters Type Name Description TObject dto

Data transfer object to read from.

MemoryAllocator<byte> allocator

The memory allocator.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns Type Parameters Name Description TObject

The type of data transfer object.

Exceptions | Edit this page View Source ToStringAsync<TObject>(TObject, Encoding, MemoryAllocator<byte>?, CancellationToken)

Converts DTO content to string.

Declaration
public static ValueTask<string> ToStringAsync<TObject>(this TObject dto, Encoding encoding, MemoryAllocator<byte>? allocator = null, CancellationToken token = default) where TObject : IDataTransferObject
Parameters Type Name Description TObject dto

Data transfer object to read from.

Encoding encoding

The encoding used to decode stored string.

MemoryAllocator<byte> allocator

The memory allocator.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns Type Parameters Name Description TObject

The type of data transfer object.

Exceptions | Edit this page View Source TransformAsync<TResult, TObject>(TObject, Func<IAsyncBinaryReader, CancellationToken, ValueTask<TResult>>, CancellationToken)

Converts data transfer object to another type.

Declaration
public static ValueTask<TResult> TransformAsync<TResult, TObject>(this TObject dto, Func<IAsyncBinaryReader, CancellationToken, ValueTask<TResult>> transformation, CancellationToken token = default) where TObject : IDataTransferObject
Parameters Returns Type Description ValueTask<TResult>

The converted DTO content.

Type Parameters Name Description TResult

The type of result.

TObject

The type of the data transfer object.

Exceptions | Edit this page View Source WriteToAsync<TObject>(TObject, IBufferWriter<byte>, CancellationToken)

Copies the object content to the specified buffer.

Declaration
public static ValueTask WriteToAsync<TObject>(this TObject dto, IBufferWriter<byte> writer, CancellationToken token = default) where TObject : IDataTransferObject
Parameters Type Name Description TObject dto

Transfer data object to transform.

IBufferWriter<byte> writer

The buffer writer.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns Type Description ValueTask

The task representing state of asynchronous execution.

Type Parameters Name Description TObject

The type of data transfer object.

Exceptions | Edit this page View Source WriteToAsync<TObject>(TObject, PipeWriter, long, CancellationToken)

Copies the object content to the specified pipe writer.

Declaration
public static ValueTask WriteToAsync<TObject>(this TObject dto, PipeWriter output, long bufferSize = 0, CancellationToken token = default) where TObject : IDataTransferObject
Parameters Type Name Description TObject dto

Transfer data object to transform.

PipeWriter output

The pipe writer receiving object content.

long bufferSize

The maximum numbers of bytes that can be buffered in the memory without flushing.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns Type Description ValueTask

The task representing state of asynchronous execution.

Type Parameters Name Description TObject

The type of data transfer object.

Exceptions | Edit this page View Source WriteToAsync<TObject>(TObject, Stream, int, CancellationToken)

Copies the object content to the specified stream.

Declaration
public static ValueTask WriteToAsync<TObject>(this TObject dto, Stream output, int bufferSize = 1024, CancellationToken token = default) where TObject : IDataTransferObject
Parameters Type Name Description TObject dto

Transfer data object to transform.

Stream output

The output stream receiving object content.

int bufferSize

The size of the buffer to be used for transformation.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns Type Description ValueTask

The task representing state of asynchronous execution.

Type Parameters Name Description TObject

The type of data transfer object.

Exceptions | Edit this page View Source WriteToAsync<TObject>(TObject, Stream, Memory<byte>, CancellationToken)

Copies the object content into the specified stream.

Declaration
public static ValueTask WriteToAsync<TObject>(this TObject dto, Stream output, Memory<byte> buffer, CancellationToken token = default) where TObject : IDataTransferObject
Parameters Type Name Description TObject dto

Transfer data object to transform.

Stream output

The output stream receiving object content.

Memory<byte> buffer

The buffer to be used for transformation.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns Type Description ValueTask

The task representing state of asynchronous execution.

Type Parameters Name Description TObject

The type of data transfer object.

Exceptions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4