Interface IUnmanagedMemory
Represents common interface for the wrapper of the unmanaged memory.
Inherited Members
Namespace: DotNext.Runtime.InteropServices
Assembly: DotNext.Unsafe.dll
Syntax
[CLSCompliant(false)]
public interface IUnmanagedMemory : IDisposable, ISupplier<Stream>, IFunctional<Func<Stream>>
Properties
| Edit this page View SourceBytes
Gets a span of bytes from the current instance.
Declaration
Span<byte> Bytes { get; }
Property Value
Type | Description |
---|---|
Span<byte> |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
Pointer
Gets a pointer to the allocated unmanaged memory.
Declaration
Pointer<byte> Pointer { get; }
Property Value
Type | Description |
---|---|
Pointer<byte> |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
Size
Gets size of referenced unmanaged memory, in bytes.
Declaration
nuint Size { get; }
Property Value
Type | Description |
---|---|
nuint |
Methods
| Edit this page View SourceAsStream()
Represents unmanaged memory as stream.
Declaration
Stream AsStream()
Returns
Type | Description |
---|---|
Stream | The stream of unmanaged memory. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
Clear()
Sets all bits of allocated memory to zero.
Declaration
void Clear()
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |