SafeBuffer.Write<T>(UInt64, T) 方法

定義

重要

此 API 不符合 CLS 規範。

將實值型別寫入至記憶體中指定的位置。

public:
generic <typename T>
 where T : value class void Write(System::UInt64 byteOffset, T value);
[System.CLSCompliant(false)]
public void Write<T> (ulong byteOffset, T value) where T : struct;
[<System.CLSCompliant(false)>]
member this.Write : uint64 * 'T -> unit (requires 'T : struct)
Public Sub Write(Of T As Structure) (byteOffset As ULong, value As T)

類型參數

T

要寫入的實值型別。

參數

byteOffset
UInt64

要開始寫入的位置。 您可能必須考慮對齊問題。

value
T

要寫入的值。

屬性

例外狀況

尚未呼叫 Initialize 方法。

備註

這個方法相當於下列程式代碼:

*(T*)(bytePtr + byteOffset) = value;  

適用於

另請參閱