Dela via


Buffer Class

Definition

Provides a default implementation of the IBuffer interface and its related interfaces.

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
Inheritance
Object Platform::Object IInspectable Buffer
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

For more info, see Create, write, and read a file, which shows how to read and write bytes to a file by using a Buffer.

Constructors

Buffer(UInt32)

Initializes a new instance of the Buffer class with the specified capacity.

Properties

Capacity

Gets the maximum number of bytes that the buffer can hold.

Length

Gets the number of bytes currently in use in the buffer.

Methods

CreateCopyFromMemoryBuffer(IMemoryBuffer)

Creates a new buffer containing a copy of a specified buffer.

CreateMemoryBufferOverIBuffer(IBuffer)

Creates a MemoryBuffer from an existing IBuffer.

Applies to

See also