What is IBuffer for?

c#, interface

Solution

From MSDN:

When you implement the IBuffer interface, you must implement the IBufferByteAccess interface, which is a COM interface for accessing the buffer directly

So to answer your second question the accessing the data is taken care for by the implemntation of the IBufferByteAccess interface.

As to use cases MSDN says:

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

You can find more here

Problem

Tinkering with some low-level code, I stumbled upon .Net's `IBuffer` interface. This interface declares just two properties - `Length` and `Capacity`. Questions: - What is this interface for? - Since only `Length` and `Capacity` are exposed, how can a callee access the actual data?

Original source