Struct BytesCore
Namespace: Tool.Sockets.Kernels
Assembly: Tool.Net.dll
资源 对象(必须回收,丢失风险大)
public struct BytesCore : IBytesCore, IDisposable, IAsyncDisposableImplements
IBytesCore, IDisposable, IAsyncDisposable
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Extension Methods
ObjectExtension.Add<T>(object, object, object), ObjectExtension.CopyEntity(object, object, params string[]), ObjectExtension.EntityToJson(object), ObjectExtension.EntityToJson(object, bool), ObjectExtension.EntityToJson(object, bool, string), DictionaryExtension.GetDictionary(object), TypeExtension.GetFieldKey(object, string, out bool), TypeExtension.GetFieldKey<T>(object, string, out bool), TypeExtension.GetFieldKey(object, Type, string, out bool), ObjectExtension.GetIntPtr(object), ObjectExtension.GetIntPtrInt(object), TypeExtension.GetPropertieFind(object, string, bool), TypeExtension.GetProperties(object), TypeExtension.GetPropertyKey(object, string, out bool), TypeExtension.GetPropertyKey<T>(object, string, out bool), TypeExtension.GetPropertyKey(object, Type, string, out bool), TypeExtension.GetValue(object, PropertyDescriptor), TypeExtension.GetValue(object, string, bool), TypeExtension.GetValue(object, string), ObjectExtension.Read<T>(object, object, int, int), ObjectExtension.Read<T>(object, int, object, int, int), DictionaryExtension.SetDictionary(object, IDictionary<string, object>), TypeExtension.SetFieldKey(object, string, object), TypeExtension.SetFieldKey<T>(object, string, object), TypeExtension.SetFieldKey(object, Type, string, object), TypeExtension.SetPropertyKey(object, string, object), TypeExtension.SetPropertyKey<T>(object, string, object), TypeExtension.SetPropertyKey(object, Type, string, object), TypeExtension.SetValue(object, PropertyDescriptor, object), TypeExtension.SetValue(object, string, object, bool), TypeExtension.SetValue(object, string, object), ObjectExtension.ToBase64String(object), ObjectExtension.ToBytes(object), ObjectExtension.ToBytes(object, out Type), DictionaryExtension.ToDictionary(object), DictionaryExtension.ToDictionary<T>(object), DictionaryExtension.ToIDictionary(object), DictionaryExtension.ToIDictionary<T>(object), ObjectExtension.ToJson(object), ObjectExtension.ToJson(object, JsonSerializerOptions), ObjectExtension.ToJsonWeb(object), ObjectExtension.ToJsonWeb(object, Action<JsonSerializerOptions>), ObjectExtension.ToTryVar<T>(object, T), ObjectExtension.ToVar<T>(object), ObjectExtension.ToVar(object, Type, bool), ObjectExtension.ToVar(object, string), ObjectExtension.ToXml(object)
Constructors
BytesCore(int)
创建一个内存资源对象
public BytesCore(int length)Parameters
length int
内存大小
BytesCore(IMemoryOwner<byte>, int)
资源对象
public BytesCore(IMemoryOwner<byte> dataOwner, int length)Parameters
dataOwner IMemoryOwner<byte>
可回收数据对象
length int
包含长度
Fields
Empty
获取空对象
public static readonly BytesCore EmptyField Value
Properties
Array
获取连续内存
public readonly ArraySegment<byte> Array { get; }Property Value
IsDispose
获取是否被回收
public readonly bool IsDispose { get; }Property Value
IsEmpty
是否为空对象
public readonly bool IsEmpty { get; }Property Value
Length
流长度
public readonly int Length { get; }Property Value
Memory
返回数据
public readonly Memory<byte> Memory { get; }Property Value
Span
返回数据
public readonly Span<byte> Span { get; }Property Value
Methods
Dispose()
使用完后及时回收
public void Dispose()GetIMemoryOwner()
获取内存器核心
public readonly IMemoryOwner<byte> GetIMemoryOwner()Returns
SetMemory(in Memory<byte>)
写入有效的数据包
public readonly void SetMemory(in Memory<byte> memory)Parameters
SetMemory(in Memory<byte>, int)
写入有效的数据包
public readonly void SetMemory(in Memory<byte> memory, int start)Parameters
start int
SetMemory(in Span<byte>)
写入有效的数据包
public readonly void SetMemory(in Span<byte> span)Parameters
SetMemory(in Span<byte>, int)
写入有效的数据包
public readonly void SetMemory(in Span<byte> span, int start)Parameters
start int
TransferByte()
移交内存器
public readonly BytesCore TransferByte()