MemoryBuffer
MemoryBuffer
MemoryBuffer
MemoryBuffer
Class
Definition
Represents a reference counted memory buffer.
public : sealed class MemoryBuffer : IClosable, IMemoryBufferpublic sealed class MemoryBuffer : IDisposable, IMemoryBufferPublic NotInheritable Class MemoryBuffer Implements IDisposable, IMemoryBuffer// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Constructors
MemoryBuffer(UInt32) MemoryBuffer(UInt32) MemoryBuffer(UInt32) MemoryBuffer(UInt32)
Initializes a new MemoryBuffer instance with the specified capacity.
public : MemoryBuffer(unsigned int capacity)public MemoryBuffer(UInt32 capacity)Public Sub New(capacity As UInt32)// You can use this method in JavaScript.
- capacity
- unsigned int UInt32 UInt32 UInt32
The desired size of the new memory buffer.
Methods
Close() Close() Close() Close()
Disconnects this MemoryBuffer object from the actual memory buffer.
public : void Close()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
CreateReference() CreateReference() CreateReference() CreateReference()
Returns a new managed object that implements the IMemoryBufferReference interface.
public : IMemoryBufferReference CreateReference()public IMemoryBufferReference CreateReference()Public Function CreateReference() As IMemoryBufferReference// You can use this method in JavaScript.
A new managed object that implements the IMemoryBufferReference interface.
Remarks
This method always successfully returns a new IMemoryBufferReference object even after the IMemoryBuffer has been closed. In that case, the returned IMemoryBufferReference is already closed. Therefore, the IMemoryBufferReference instance's Capacity property will be zero and IMemoryBufferByteAccess::GetBuffer method will always return a null memory pointer and zero capacity.