Interface IDataTransferObject
Represents data unit that can be transferred over wire.
Namespace: DotNext
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IDataTransferObject
Properties
| Improve this Doc View SourceIsReusable
Indicates that the content of this object can be copied to the output stream or pipe multiple times.
Declaration
bool IsReusable { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Length
Gets length of the object payload, in bytes.
Declaration
long? Length { get; }
Property Value
| Type | Description |
|---|---|
| Nullable<Int64> |
Remarks
If value is null then length of the payload cannot be determined.
Methods
| Improve this Doc View SourceCopyToAsync(PipeWriter, CancellationToken)
Copies the object content into the specified pipe writer.
Declaration
ValueTask CopyToAsync(PipeWriter output, CancellationToken token = null)
Parameters
| Type | Name | Description |
|---|---|---|
| PipeWriter | output | The writer. |
| CancellationToken | token | The token that can be used to cancel operation. |
Returns
| Type | Description |
|---|---|
| ValueTask | The task representing asynchronous execution of this method. |
CopyToAsync(Stream, CancellationToken)
Copies the object content into the specified stream.
Declaration
Task CopyToAsync(Stream output, CancellationToken token = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | output | The output stream receiving object content. |
| CancellationToken | token | The token that can be used to cancel asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task |