Interface IUnmanagedArray<T>
Provides access to the array allocated in the unmanaged memory.
Inherited Members
Namespace: DotNext.Runtime.InteropServices
Assembly: DotNext.Unsafe.dll
Syntax
public interface IUnmanagedArray<T> : IUnmanagedMemory, IDisposable, IConvertible<Stream>, IEnumerable<T>, IEnumerable, ICloneable, IConvertible<T[]> where T : struct
Type Parameters
Name | Description |
---|---|
T | The type of the array elements. |
Properties
| Improve this Doc View SourceItem[Int32]
Gets element of the unmanaged array.
Declaration
virtual T this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the element to get. |
Property Value
Type | Description |
---|---|
T | The pointer to the array element. |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException |
|
Length
Gets the number of elements in the unmanaged memory.
Declaration
int Length { get; }
Property Value
Type | Description |
---|---|
Int32 |
Pointer
Gets a pointer to the allocated unmanaged memory.
Declaration
Pointer<T> Pointer { get; }
Property Value
Type | Description |
---|---|
Pointer<T> |
Span
Gets a span from the current instance.
Declaration
Span<T> Span { get; }
Property Value
Type | Description |
---|---|
Span<T> |
Methods
| Improve this Doc View SourceBitwiseCompare(T[])
Bitwise comparison of the memory blocks.
Declaration
virtual int BitwiseCompare(T[] other)
Parameters
Type | Name | Description |
---|---|---|
T[] | other | The array to be compared. |
Returns
Type | Description |
---|---|
Int32 | Comparison result which has the semantics as return type of CompareTo(Object). |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
BitwiseCompare(Pointer<T>)
Bitwise comparison of the memory blocks.
Declaration
virtual int BitwiseCompare(Pointer<T> other)
Parameters
Type | Name | Description |
---|---|---|
Pointer<T> | other | The block of memory to be compared. |
Returns
Type | Description |
---|---|
Int32 | Comparison result which has the semantics as return type of CompareTo(Object). |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
BitwiseEquals(T[])
Computes bitwise equality between this array and the specified managed array.
Declaration
virtual bool BitwiseEquals(T[] other)
Parameters
Type | Name | Description |
---|---|---|
T[] | other | The array to be compared. |
Returns
Type | Description |
---|---|
Boolean | true, if both memory blocks have the same bytes; otherwise, false. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
BitwiseEquals(Pointer<T>)
Computes bitwise equality between two blocks of memory.
Declaration
virtual bool BitwiseEquals(Pointer<T> other)
Parameters
Type | Name | Description |
---|---|---|
Pointer<T> | other | The block of memory to be compared. |
Returns
Type | Description |
---|---|
Boolean | true, if both memory blocks have the same bytes; otherwise, false. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
ReadFrom(T[])
Copies elements from the memory location to the managed array.
Declaration
virtual long ReadFrom(T[] source)
Parameters
Type | Name | Description |
---|---|---|
T[] | source | The source array. |
Returns
Type | Description |
---|---|
Int64 | The actual number of copied elements. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
ReadFrom(T[], Int64, Int64)
Copies elements from the specified array into the memory block identified by this object.
Declaration
virtual long ReadFrom(T[] source, long offset, long count)
Parameters
Type | Name | Description |
---|---|---|
T[] | source | The source array. |
Int64 | offset | The position in the source array from which copying begins. |
Int64 | count | The number of elements of type |
Returns
Type | Description |
---|---|
Int64 | Actual number of copied elements. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
ReadFrom(Pointer<T>)
Copies bytes from the source memory to the memory identified by this object.
Declaration
virtual void ReadFrom(Pointer<T> source)
Parameters
Type | Name | Description |
---|---|---|
Pointer<T> | source | The pointer to the source unmanaged memory. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
ToArray()
Copies elements from the unmanaged array into managed heap.
Declaration
virtual T[] ToArray()
Returns
Type | Description |
---|---|
T[] | The array allocated in managed heap containing copied elements from unmanaged memory. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
WriteTo(T[])
Copies elements from the memory location to the managed array.
Declaration
virtual long WriteTo(T[] destination)
Parameters
Type | Name | Description |
---|---|---|
T[] | destination | The destination array. |
Returns
Type | Description |
---|---|
Int64 | The actual number of copied elements. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
WriteTo(T[], Int64, Int64)
Copies elements from the memory location to the managed array.
Declaration
virtual long WriteTo(T[] destination, long offset, long count)
Parameters
Type | Name | Description |
---|---|---|
T[] | destination | The destination array. |
Int64 | offset | The position in the destination array from which copying begins. |
Int64 | count | The number of array elements to be copied. |
Returns
Type | Description |
---|---|
Int64 | The actual number of copied elements. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
WriteTo(IUnmanagedArray<T>)
Copies elements from the current memory location to the specified memory location.
Declaration
virtual long WriteTo(IUnmanagedArray<T> destination)
Parameters
Type | Name | Description |
---|---|---|
IUnmanagedArray<T> | destination | The target memory location. |
Returns
Type | Description |
---|---|
Int64 | The actual number of copied elements. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |
WriteTo(Pointer<T>)
Copies elements from the current memory location to the specified memory location.
Declaration
virtual void WriteTo(Pointer<T> destination)
Parameters
Type | Name | Description |
---|---|---|
Pointer<T> | destination | The target memory location. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The underlying unmanaged memory has been released. |