Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Buffer class

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

Syntax


Public NotInheritable Class Buffer
    Implements IBuffer

Members

The Buffer class has these types of members:

Constructors

The Buffer class has these constructors.

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

 

Methods

The Buffer class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
CreateCopyFromMemoryBuffer Creates a new buffer containing a copy of a specified buffer.
CreateMemoryBufferOverIBuffer Creates a MemoryBuffer from an existing IBuffer.

 

Properties

The Buffer class has these properties.

PropertyAccess typeDescription

Capacity

Read-only

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

Length

Read/write

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

 

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.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Storage.Streams
Windows::Storage::Streams [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8

Namespace

Windows.Storage.Streams
Windows::Storage::Streams [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Muse()]
[Threading(Both)]
[Version(0x06020000)]

See also

Quickstart: Reading and writing a file
Object
IBuffer

 

 

Show: