IBuffer interface

Represents an array of bytes.

Members

The IBuffer interface inherits from IInspectable. IBuffer also has these types of members:

  • Properties

Properties

The IBuffer interface has these properties.

Property Access type Description

Capacity

Read-only

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

Length

Read-only

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

 

Remarks

The IBuffer interface is used by the IInputStream and IOutputStream interfaces.

An IBuffer implementation must implement the IMarshal interface and marshal the contents of the buffer by value when the IBuffer is passed across a process boundary. When marshaled across apartments within a process, the IBuffer implementation must allow direct access to the buffer without synchronization.

When you implement the IBuffer interface, you must implement the IBufferByteAccess interface, which is a COM interface for accessing the buffer directly. C++ callers use this interface to avoid making a copy of the buffer.

Also, to ensure correct marshaling behavior, you must implement marshal-by-value by using the RoGetBufferMarshaler function.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Header

Robytestream.h

IDL

Robytestream.idl

See also

IInspectable

IBufferByteAccess

RoGetBufferMarshaler

IInputStream

IOutputStream

IRandomAccessStream