共用方式為


Buffer 類別

定義

提供 IBuffer 介面及其相關介面的預設實作。

public ref class Buffer sealed : IBuffer
/// [Windows.Foundation.Metadata.Activatable(Windows.Storage.Streams.IBufferFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class Buffer final : IBuffer
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Storage.Streams.IBufferFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class Buffer final : IBuffer
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Storage.Streams.IBufferFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class Buffer : IBuffer
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Storage.Streams.IBufferFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class Buffer : IBuffer
function Buffer(capacity)
Public NotInheritable Class Buffer
Implements IBuffer
繼承
Object Platform::Object IInspectable Buffer
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

如需詳細資訊,請參閱 建立、寫入和讀取檔案,其中示範如何使用 Buffer 讀取和寫入檔案的位元組。

建構函式

Buffer(UInt32)

使用指定的容量,初始化 Buffer 類別的新實例。

屬性

Capacity

取得緩衝區可以保存的最大位元組數目。

Length

取得緩衝區中目前使用的位元組數目。

方法

CreateCopyFromMemoryBuffer(IMemoryBuffer)

建立包含指定緩衝區複本的新緩衝區。

CreateMemoryBufferOverIBuffer(IBuffer)

從現有的 IBuffer 建立 MemoryBuffer

適用於

另請參閱