Buffer Buffer Buffer Class

Definition

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

public sealed class Buffer : IBufferpublic sealed class Buffer : IBufferPublic NotInheritable Class Buffer Implements IBuffer
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

For more info, see Quickstart: Reading and writing a file, which shows how to read and write bytes to a file by using a Buffer.

Constructors

Buffer(UInt32) Buffer(UInt32) Buffer(UInt32)

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

public Buffer(UInt32 capacity)public Buffer(UInt32 capacity)Public Sub New(capacity As UInt32)
Parameters
capacity
System.UInt32 System.UInt32 System.UInt32

The maximum number of bytes that the buffer can hold.

Attributes

Properties

Capacity Capacity Capacity

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

public unsigned short Capacity { get; }public uint Capacity { get; }Public ReadOnly Property Capacity As uint
Value
uint uint uint

The maximum number of bytes that the buffer can hold.

Attributes

Length Length Length

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

public unsigned short Length { get; set; }public uint Length { get; set; }Public ReadWrite Property Length As uint
Value
uint uint uint

The number of bytes currently in use in the buffer, which is less than or equal to the capacity of the buffer.

Attributes

Methods

CreateCopyFromMemoryBuffer(IMemoryBuffer) CreateCopyFromMemoryBuffer(IMemoryBuffer) CreateCopyFromMemoryBuffer(IMemoryBuffer)

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

public static Buffer CreateCopyFromMemoryBuffer(IMemoryBuffer input)public static Buffer CreateCopyFromMemoryBuffer(IMemoryBuffer input)Public Static Function CreateCopyFromMemoryBuffer(input As IMemoryBuffer) As Buffer
Parameters
input
IMemoryBuffer IMemoryBuffer IMemoryBuffer

The buffer to be copied.

Returns

The newly created copy.

Attributes

CreateMemoryBufferOverIBuffer(IBuffer) CreateMemoryBufferOverIBuffer(IBuffer) CreateMemoryBufferOverIBuffer(IBuffer)

Creates a MemoryBuffer from an existing IBuffer.

public static MemoryBuffer CreateMemoryBufferOverIBuffer(IBuffer input)public static MemoryBuffer CreateMemoryBufferOverIBuffer(IBuffer input)Public Static Function CreateMemoryBufferOverIBuffer(input As IBuffer) As MemoryBuffer
Parameters
input
IBuffer IBuffer IBuffer

The input IBuffer.

Returns
Attributes

See Also