[]
Pointer to a native buffer with a specific size.
public struct DataPointer : IEquatable<DataPointer>
Initializes a new instance of the DataPointer struct.
public DataPointer(IntPtr pointer, int size)
pointer System.IntPtrThe pointer.
size intThe size.
Initializes a new instance of the DataPointer struct.
[CLSCompliant(false)]
public DataPointer(void* pointer, int size)
pointer void*The pointer.
size intThe size.
Pointer to the buffer.
public IntPtr Pointer
Size in bytes of the buffer.
public int Size
Gets an Empty Data Pointer.
public static readonly DataPointer Zero
Gets a value indicating whether this instance is empty (zeroed).
public bool IsEmpty { get; }
true if this instance is empty; otherwise, false.
Writes the content of the specified buffer to the unmanaged memory location of this instance.
public void CopyFrom<T>(T[] buffer, int offset, int count) where T : struct
buffer T[]The buffer to read from.
offset intThe offset in the array to read from.
count intThe number of T element to write to the memory location.
Tbuffer
DataPointer is Zero
buffer;Total buffer size cannot be larger than size of this data pointer
Writes the content of the specified buffer to the unmanaged memory location of this instance.
public void CopyFrom<T>(T[] buffer) where T : struct
buffer T[]The buffer.
TType of a buffer element
buffer
DataPointer is Zero
Reads the content of the unmanaged memory location of this instance to the specified buffer.
public void CopyTo<T>(T[] buffer, int offset, int count) where T : struct
buffer T[]The buffer.
offset intThe offset in the array to write to.
count intThe number of T element to read from the memory location.
TType of a buffer element
buffer
DataPointer is Zero
buffer;Total buffer size cannot be larger than size of this data pointer
Determines whether the specified DataPointer is equal to the current object.
public bool Equals(DataPointer other)
other DataPointerDetermines whether the specified object is equal to the current object.
public override bool Equals(object obj)
obj objectServes as the default hash function.
public override int GetHashCode()
Converts this instance to a read only byte buffer.
public byte[] ToArray()
Converts this instance to a read only typed buffer.
public T[] ToArray<T>() where T : struct
A readonly typed buffer.
TType of a buffer element
DataPointer is Zero
Converts this DataPointer to a DataStream.
public DataStream ToDataStream()
An instance of a DataStream.
Implements the ==.
public static bool operator ==(DataPointer left, DataPointer right)
left DataPointerThe left.
right DataPointerThe right.
The result of the operator.
Implements the !=.
public static bool operator !=(DataPointer left, DataPointer right)
left DataPointerThe left.
right DataPointerThe right.
The result of the operator.