一款简单易用的基础网络通讯组件库。

PipeBytesWriter 结构

表示一个基于PipeWriter的字节写入器,提供对管道写入器的高性能包装。 实现了IBytesWriter接口,支持异步刷新操作。

Definition

命名空间: TouchSocket.Core
程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:4.0.0-beta.143+5fcca7a4e70968794985dc3793adc50531308be6
C#
public struct PipeBytesWriter : IBytesWriter, 
	IBufferWriter<byte>
Inheritance
Object    ValueType    PipeBytesWriter
Implements
IBufferWriterByte, IBytesWriter

备注

PipeBytesWriter作为值类型实现,为System.IO.Pipelines的PipeWriter提供了IBytesWriter接口的适配。 适用于需要与管道系统集成的高性能字节写入场景,不支持回退操作。 提供了异步刷新功能,可以与异步I/O操作良好配合。

构造函数

PipeBytesWriter 使用指定的管道写入器初始化PipeBytesWriter的新实例。

属性

SupportsRewind 获取一个值,该值指示写入器是否支持回退操作。
Version 获取写入器的版本号。
WrittenCount 获取已写入的字节总数。

方法

AdvanceNotifies the IBufferWriterT that count data items were written to the output SpanT or MemoryT.
EqualsIndicates whether this instance and a specified object are equal.
(继承自 ValueType。)
FlushAsync 异步刷新底层管道写入器,确保缓冲的数据被写入到目标。
GetHashCodeReturns the hash code for this instance.
(继承自 ValueType。)
GetMemoryReturns a MemoryT to write to that is at least the requested size (specified by sizeHint).
GetSpanReturns a SpanT to write to that is at least the requested size (specified by sizeHint).
GetTypeGets the Type of the current instance.
(继承自 Object。)
ToStringReturns the fully qualified type name of this instance.
(继承自 ValueType。)
Write 将指定的字节跨度写入到写入器中。

扩展方法

Map 将源对象的属性映射到目标对象的属性中。
(由 Mapper 定义。)
Map 将源对象映射到目标类型的实例。
(由 Mapper 定义。)
MapTTarget 将源对象映射到指定目标类型的新实例。
(由 Mapper 定义。)
ToJsonString 转换为Json
(由 SerializeConvert 定义。)

参见