RandomAccess.Write 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Write(SafeFileHandle, IReadOnlyList<ReadOnlyMemory<Byte>>, Int64) |
從給定緩衝區寫入一串位元組到指定偏移的檔案。 |
| Write(SafeFileHandle, ReadOnlySpan<Byte>, Int64) |
從指定緩衝區寫入一串位元組到指定偏移量的檔案。 |
Write(SafeFileHandle, IReadOnlyList<ReadOnlyMemory<Byte>>, Int64)
從給定緩衝區寫入一串位元組到指定偏移的檔案。
public:
static void Write(Microsoft::Win32::SafeHandles::SafeFileHandle ^ handle, System::Collections::Generic::IReadOnlyList<ReadOnlyMemory<System::Byte>> ^ buffers, long fileOffset);
public static void Write(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Collections.Generic.IReadOnlyList<ReadOnlyMemory<byte>> buffers, long fileOffset);
static member Write : Microsoft.Win32.SafeHandles.SafeFileHandle * System.Collections.Generic.IReadOnlyList<ReadOnlyMemory<byte>> * int64 -> unit
Public Shared Sub Write (handle As SafeFileHandle, buffers As IReadOnlyList(Of ReadOnlyMemory(Of Byte)), fileOffset As Long)
參數
- handle
- SafeFileHandle
檔句柄。
- buffers
- IReadOnlyList<ReadOnlyMemory<Byte>>
一份記憶體緩衝區清單。 此方法會將這些緩衝區的內容複製到檔案中。
- fileOffset
- Int64
要寫入的檔案位置。
例外狀況
handle 或 buffers 為 null。
handle 無效。
檔案已結案。
該檔案不支援尋址(管道或套接字)。
fileOffset 為負數。
handle 未開放書寫。
發生 I/O 錯誤。
備註
檔案位置不前。
適用於
Write(SafeFileHandle, ReadOnlySpan<Byte>, Int64)
從指定緩衝區寫入一串位元組到指定偏移量的檔案。
public:
static void Write(Microsoft::Win32::SafeHandles::SafeFileHandle ^ handle, ReadOnlySpan<System::Byte> buffer, long fileOffset);
public static void Write(Microsoft.Win32.SafeHandles.SafeFileHandle handle, ReadOnlySpan<byte> buffer, long fileOffset);
static member Write : Microsoft.Win32.SafeHandles.SafeFileHandle * ReadOnlySpan<byte> * int64 -> unit
Public Shared Sub Write (handle As SafeFileHandle, buffer As ReadOnlySpan(Of Byte), fileOffset As Long)
參數
- handle
- SafeFileHandle
檔句柄。
- buffer
- ReadOnlySpan<Byte>
一個記憶區域。 此方法會將該區域的內容複製到檔案中。
- fileOffset
- Int64
要寫入的檔案位置。
例外狀況
handle 是 null。
handle 無效。
檔案已結案。
該檔案不支援尋址(管道或套接字)。
fileOffset 為負數。
handle 未開放書寫。
發生 I/O 錯誤。
備註
檔案位置不前。