UnmanagedMemoryAccessor.Write 方法

定义

将值写入访问器。

重载

名称 说明
Write(Int64, UInt64)

将无符号 64 位整数写入访问器。

Write(Int64, UInt32)

将无符号 32 位整数写入访问器。

Write(Int64, UInt16)

将无符号 16 位整数写入访问器。

Write(Int64, Single)

将 a Single 写入访问器。

Write(Int64, SByte)

将 8 位整数写入访问器。

Write(Int64, Int64)

将 64 位整数写入访问器。

Write(Int64, Double)

将值 Double 写入访问器。

Write(Int64, Int16)

将 16 位整数写入访问器。

Write(Int64, Decimal)

将十进制值写入访问器。

Write(Int64, Char)

将字符写入访问器。

Write(Int64, Byte)

将字节值写入访问器。

Write(Int64, Boolean)

将布尔值写入访问器。

Write(Int64, Int32)

将 32 位整数写入访问器。

Write<T>(Int64, T)

将结构写入访问器。

Write(Int64, UInt64)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

重要

此 API 不符合 CLS。

符合 CLS 的替代方案
System.Decimal

将无符号 64 位整数写入访问器。

public:
 void Write(long position, System::UInt64 value);
[System.CLSCompliant(false)]
public void Write(long position, ulong value);
[<System.CLSCompliant(false)>]
member this.Write : int64 * uint64 -> unit
Public Sub Write (position As Long, value As ULong)

参数

position
Int64

访问器中开始写入的字节数。

value
UInt64

要写入的值。

属性

例外

写入值后 position 没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write(Int64, UInt32)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

重要

此 API 不符合 CLS。

符合 CLS 的替代方案
System.Int64

将无符号 32 位整数写入访问器。

public:
 void Write(long position, System::UInt32 value);
[System.CLSCompliant(false)]
public void Write(long position, uint value);
[<System.CLSCompliant(false)>]
member this.Write : int64 * uint32 -> unit
Public Sub Write (position As Long, value As UInteger)

参数

position
Int64

访问器中开始写入的字节数。

value
UInt32

要写入的值。

属性

例外

写入值后 position 没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write(Int64, UInt16)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

重要

此 API 不符合 CLS。

符合 CLS 的替代方案
System.Int32

将无符号 16 位整数写入访问器。

public:
 void Write(long position, System::UInt16 value);
[System.CLSCompliant(false)]
public void Write(long position, ushort value);
[<System.CLSCompliant(false)>]
member this.Write : int64 * uint16 -> unit
Public Sub Write (position As Long, value As UShort)

参数

position
Int64

访问器中开始写入的字节数。

value
UInt16

要写入的值。

属性

例外

写入值后 position 没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write(Int64, Single)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

将 a Single 写入访问器。

public:
 void Write(long position, float value);
public void Write(long position, float value);
member this.Write : int64 * single -> unit
Public Sub Write (position As Long, value As Single)

参数

position
Int64

访问器中开始写入的字节数。

value
Single

要写入的值。

例外

写入值后 position 没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write(Int64, SByte)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

重要

此 API 不符合 CLS。

符合 CLS 的替代方案
System.Int16

将 8 位整数写入访问器。

public:
 void Write(long position, System::SByte value);
[System.CLSCompliant(false)]
public void Write(long position, sbyte value);
[<System.CLSCompliant(false)>]
member this.Write : int64 * sbyte -> unit
Public Sub Write (position As Long, value As SByte)

参数

position
Int64

访问器中开始写入的字节数。

value
SByte

要写入的值。

属性

例外

写入值后 position 没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write(Int64, Int64)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

将 64 位整数写入访问器。

public:
 void Write(long position, long value);
public void Write(long position, long value);
member this.Write : int64 * int64 -> unit
Public Sub Write (position As Long, value As Long)

参数

position
Int64

访问器中开始写入的字节数。

value
Int64

要写入的值。

例外

在写入值的位置后没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write(Int64, Double)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

将值 Double 写入访问器。

public:
 void Write(long position, double value);
public void Write(long position, double value);
member this.Write : int64 * double -> unit
Public Sub Write (position As Long, value As Double)

参数

position
Int64

访问器中开始写入的字节数。

value
Double

要写入的值。

例外

写入值后 position 没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write(Int64, Int16)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

将 16 位整数写入访问器。

public:
 void Write(long position, short value);
public void Write(long position, short value);
member this.Write : int64 * int16 -> unit
Public Sub Write (position As Long, value As Short)

参数

position
Int64

访问器中开始写入的字节数。

value
Int16

要写入的值。

例外

写入值后 position 没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write(Int64, Decimal)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

将十进制值写入访问器。

public:
 void Write(long position, System::Decimal value);
public void Write(long position, decimal value);
member this.Write : int64 * decimal -> unit
Public Sub Write (position As Long, value As Decimal)

参数

position
Int64

访问器中开始写入的字节数。

value
Decimal

要写入的值。

例外

写入值后 position 没有足够的字节。

-或-

小数无效。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write(Int64, Char)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

将字符写入访问器。

public:
 void Write(long position, char value);
public void Write(long position, char value);
member this.Write : int64 * char -> unit
Public Sub Write (position As Long, value As Char)

参数

position
Int64

访问器中开始写入的字节数。

value
Char

要写入的值。

例外

写入值后 position 没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write(Int64, Byte)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

将字节值写入访问器。

public:
 void Write(long position, System::Byte value);
public void Write(long position, byte value);
member this.Write : int64 * byte -> unit
Public Sub Write (position As Long, value As Byte)

参数

position
Int64

访问器中开始写入的字节数。

value
Byte

要写入的值。

例外

写入值后 position 没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write(Int64, Boolean)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

将布尔值写入访问器。

public:
 void Write(long position, bool value);
public void Write(long position, bool value);
member this.Write : int64 * bool -> unit
Public Sub Write (position As Long, value As Boolean)

参数

position
Int64

访问器中开始写入的字节数。

value
Boolean

要写入的值。

例外

写入值后 position 没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write(Int64, Int32)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

将 32 位整数写入访问器。

public:
 void Write(long position, int value);
public void Write(long position, int value);
member this.Write : int64 * int -> unit
Public Sub Write (position As Long, value As Integer)

参数

position
Int64

访问器中开始写入的字节数。

value
Int32

要写入的值。

例外

写入值后 position 没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

适用于

Write<T>(Int64, T)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

将结构写入访问器。

public:
generic <typename T>
 where T : value class void Write(long position, T % structure);
public void Write<T>(long position, ref T structure) where T : struct;
[System.Security.SecurityCritical]
public void Write<T>(long position, ref T structure) where T : struct;
member this.Write : int64 * 'T -> unit (requires 'T : struct)
[<System.Security.SecurityCritical>]
member this.Write : int64 * 'T -> unit (requires 'T : struct)
Public Sub Write(Of T As Structure) (position As Long, ByRef structure As T)

类型参数

T

结构的类型。

参数

position
Int64

访问器中开始写入的字节数。

structure
T

要写入的结构。

属性

例外

在编写类型position结构之后T,访问器中没有足够的字节。

position 小于零或大于访问器的容量。

访问器不支持写入。

已释放访问器。

注解

使用此方法将中等结构写入大型结构,这些结构不容易被此类中的其他 Write 方法容纳。

适用于