Show / Hide Table of Contents

Class Serializable

Extends ISerializable<TSelf> implementing types.

Inheritance
object
Serializable
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: DotNext.Runtime.Serialization
Assembly: DotNext.IO.dll
Syntax
public static class Serializable

Methods

View Source

ReadFromAsync<T>(PipeReader, CancellationToken)

Deserializes the object from the pipe.

Declaration
public static ValueTask<T> ReadFromAsync<T>(PipeReader reader, CancellationToken token = default) where T : notnull, ISerializable<T>
Parameters
Type Name Description
PipeReader reader

The pipe reader.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<T>

Deserialized object.

Type Parameters
Name Description
T
Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

View Source

ReadFromAsync<T>(Stream, int, CancellationToken)

Deserializes the object from the stream.

Declaration
public static ValueTask<T> ReadFromAsync<T>(Stream input, int bufferSize = 128, CancellationToken token = default) where T : notnull, ISerializable<T>
Parameters
Type Name Description
Stream input

The stream containing serialized data.

int bufferSize

The size of the buffer to be used for reading from the stream.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<T>

Deserialized object.

Type Parameters
Name Description
T
Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

View Source

ReadFromAsync<T>(Stream, Memory<byte>, CancellationToken)

Deserializes the object from the stream.

Declaration
public static ValueTask<T> ReadFromAsync<T>(Stream input, Memory<byte> buffer, CancellationToken token = default) where T : ISerializable<T>
Parameters
Type Name Description
Stream input

The stream containing serialized data.

Memory<byte> buffer

The buffer to be used for reading from the stream.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<T>

Deserialized object.

Type Parameters
Name Description
T
Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾