NativeMemoryStream 结构
Native memory stream
命名空间: NativeCollections
程序集: Fantasy.Net.dll
语法
[StructLayout(LayoutKind.Sequential)]
public struct NativeMemoryStream : IDisposable, IEquatable<NativeMemoryStream>
构造函数
| 编辑本文 查看源代码NativeMemoryStream(int)
Structure
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public NativeMemoryStream(int capacity)
参数
类型 | 名称 | 描述 |
---|---|---|
int | capacity | Capacity |
属性
| 编辑本文 查看源代码CanRead
Can read
声明
public bool CanRead { get; }
属性值
类型 | 描述 |
---|---|
bool |
CanSeek
Can seek
声明
public bool CanSeek { get; }
属性值
类型 | 描述 |
---|---|
bool |
CanWrite
Can write
声明
public bool CanWrite { get; }
属性值
类型 | 描述 |
---|---|
bool |
Capacity
Capacity
声明
public int Capacity { get; set; }
属性值
类型 | 描述 |
---|---|
int |
Empty
Empty
声明
public static NativeMemoryStream Empty { get; }
属性值
类型 | 描述 |
---|---|
NativeMemoryStream |
IsCreated
Is created
声明
public bool IsCreated { get; }
属性值
类型 | 描述 |
---|---|
bool |
IsEmpty
Is empty
声明
public bool IsEmpty { get; }
属性值
类型 | 描述 |
---|---|
bool |
this[int]
Get reference
声明
public ref byte this[int index] { get; }
参数
类型 | 名称 | 描述 |
---|---|---|
int | index | Index |
属性值
类型 | 描述 |
---|---|
byte |
this[uint]
Get reference
声明
public ref byte this[uint index] { get; }
参数
类型 | 名称 | 描述 |
---|---|---|
uint | index | Index |
属性值
类型 | 描述 |
---|---|
byte |
Length
Length
声明
public int Length { get; }
属性值
类型 | 描述 |
---|---|
int |
Position
Position
声明
public int Position { get; set; }
属性值
类型 | 描述 |
---|---|
int |
方法
| 编辑本文 查看源代码AsReadOnlySpan()
As readOnly span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ReadOnlySpan<byte> AsReadOnlySpan()
返回
类型 | 描述 |
---|---|
ReadOnlySpan<byte> | ReadOnlySpan |
AsReadOnlySpan(int)
As readOnly span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ReadOnlySpan<byte> AsReadOnlySpan(int length)
参数
类型 | 名称 | 描述 |
---|---|---|
int | length | Length |
返回
类型 | 描述 |
---|---|
ReadOnlySpan<byte> | ReadOnlySpan |
AsReadOnlySpan(int, int)
As readOnly span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ReadOnlySpan<byte> AsReadOnlySpan(int start, int length)
参数
类型 | 名称 | 描述 |
---|---|---|
int | start | Start |
int | length | Length |
返回
类型 | 描述 |
---|---|
ReadOnlySpan<byte> | ReadOnlySpan |
AsSpan()
As span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<byte> AsSpan()
返回
类型 | 描述 |
---|---|
Span<byte> | Span |
AsSpan(int)
As span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<byte> AsSpan(int length)
参数
类型 | 名称 | 描述 |
---|---|---|
int | length | Length |
返回
类型 | 描述 |
---|---|
Span<byte> | Span |
AsSpan(int, int)
As span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<byte> AsSpan(int start, int length)
参数
类型 | 名称 | 描述 |
---|---|---|
int | start | Start |
int | length | Length |
返回
类型 | 描述 |
---|---|
Span<byte> | Span |
Dispose()
Dispose
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Dispose()
Equals(NativeMemoryStream)
Equals
声明
public bool Equals(NativeMemoryStream other)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeMemoryStream | other | Other |
返回
类型 | 描述 |
---|---|
bool | Equals |
Equals(object?)
Equals
声明
public override bool Equals(object? obj)
参数
类型 | 名称 | 描述 |
---|---|---|
object | obj | object |
返回
类型 | 描述 |
---|---|
bool | Equals |
重写
| 编辑本文 查看源代码GetBuffer()
Get buffer
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public byte* GetBuffer()
返回
类型 | 描述 |
---|---|
byte* | Buffer |
GetHashCode()
Get hashCode
声明
public override int GetHashCode()
返回
类型 | 描述 |
---|---|
int | HashCode |
重写
| 编辑本文 查看源代码Read(byte*, int, int)
Read
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int Read(byte* buffer, int offset, int count)
参数
类型 | 名称 | 描述 |
---|---|---|
byte* | buffer | Buffer |
int | offset | Offset |
int | count | Count |
返回
类型 | 描述 |
---|---|
int | Bytes |
Read(Span<byte>)
Read
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int Read(Span<byte> buffer)
参数
类型 | 名称 | 描述 |
---|---|---|
Span<byte> | buffer | Buffer |
返回
类型 | 描述 |
---|---|
int | Bytes |
ReadByte()
Read
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int ReadByte()
返回
类型 | 描述 |
---|---|
int | Byte |
Seek(int, SeekOrigin)
Seek
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int Seek(int offset, SeekOrigin loc)
参数
类型 | 名称 | 描述 |
---|---|---|
int | offset | Offset |
SeekOrigin | loc | Seek origin |
返回
类型 | 描述 |
---|---|
int | Position |
SetLength(int)
Set length
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetLength(int length)
参数
类型 | 名称 | 描述 |
---|---|---|
int | length | Length |
ToString()
To string
声明
public override string ToString()
返回
类型 | 描述 |
---|---|
string | String |
重写
| 编辑本文 查看源代码Write(byte*, int, int)
Write
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Write(byte* buffer, int offset, int count)
参数
类型 | 名称 | 描述 |
---|---|---|
byte* | buffer | Buffer |
int | offset | Offset |
int | count | Count |
Write(ReadOnlySpan<byte>)
Write
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Write(ReadOnlySpan<byte> buffer)
参数
类型 | 名称 | 描述 |
---|---|---|
ReadOnlySpan<byte> | buffer | Buffer |
WriteByte(byte)
Write
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void WriteByte(byte value)
参数
类型 | 名称 | 描述 |
---|---|---|
byte | value | Byte |
运算符
| 编辑本文 查看源代码operator ==(NativeMemoryStream, NativeMemoryStream)
Equals
声明
public static bool operator ==(NativeMemoryStream left, NativeMemoryStream right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeMemoryStream | left | Left |
NativeMemoryStream | right | Right |
返回
类型 | 描述 |
---|---|
bool | Equals |
implicit operator ReadOnlySpan<byte>(NativeMemoryStream)
As readOnly span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<byte>(NativeMemoryStream nativeList)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeMemoryStream | nativeList |
返回
类型 | 描述 |
---|---|
ReadOnlySpan<byte> | ReadOnlySpan |
implicit operator Span<byte>(NativeMemoryStream)
As span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator Span<byte>(NativeMemoryStream nativeList)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeMemoryStream | nativeList |
返回
类型 | 描述 |
---|---|
Span<byte> | Span |
operator !=(NativeMemoryStream, NativeMemoryStream)
Not equals
声明
public static bool operator !=(NativeMemoryStream left, NativeMemoryStream right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeMemoryStream | left | Left |
NativeMemoryStream | right | Right |
返回
类型 | 描述 |
---|---|
bool | Not equals |