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

SegmentedPipe 类

表示一个分段管道,提供基于内存池的高效读写缓冲区管理

Definition

命名空间: TouchSocket.Core
程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:4.1.4.7+7f7e1f78093c99347956e09330d5d7aca1d2bdf2
C#
public class SegmentedPipe : DisposableObject
Inheritance
Object    DisposableObject    SegmentedPipe

备注

SegmentedPipe使用分段式内存管理,从ArrayPoolT按需申请内存段, 读取推进时自动回收已读段。仅支持单线程同步场景。

构造函数

SegmentedPipe 初始化SegmentedPipe的新实例

属性

Count 获取当前已写入但未消费的字节数
DisposedValue 标识该对象是否已被释放
(继承自 DisposableObject。)
Reader 获取读取器
Writer 获取写入器

方法

Dispose 释放资源。内部已经处理了SuppressFinalize(Object)
(继承自 DisposableObject。)
Dispose(Boolean) 处置资源
(重写 DisposableObjectDispose(Boolean))
EqualsDetermines whether the specified object is equal to the current object.
(继承自 Object。)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(继承自 Object。)
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
MemberwiseCloneCreates a shallow copy of the current Object.
(继承自 Object。)
ThrowIfDisposed 判断当前对象是否已经被释放。 如果已经被释放,则抛出ObjectDisposedException异常。
(继承自 DisposableObject。)
ToStringReturns a string that represents the current object.
(继承自 Object。)

扩展方法

ToJsonString 转换为Json
(由 SerializeConvert 定义。)

参见