Class UnmanagedVector
Wrapped class of the C++ standard vector of Byte.
public abstract class UnmanagedVector : Stream, IDisposable, IAsyncDisposable
- Inheritance
-
UnmanagedVector
- Implements
- Derived
- Inherited Members
Constructors
UnmanagedVector()
protected UnmanagedVector()
Fields
_ptr
A pointer to the unmanaged object
protected nint _ptr
Field Value
Properties
CanRead
public override bool CanRead { get; }
Property Value
CanSeek
public override bool CanSeek { get; }
Property Value
CanWrite
public override bool CanWrite { get; }
Property Value
Length
public override long Length { get; }
Property Value
Position
public override long Position { get; set; }
Property Value
Ptr
Pointer to the unmanaged object
public nint Ptr { get; }
Property Value
Size
Get the size of the vector
public abstract int Size { get; }
Property Value
StartAddress
The pointer to the first element on the vector. In case of an empty vector, IntPtr.Zero will be returned.
public abstract nint StartAddress { get; }
Property Value
Methods
Dispose()
The dispose function that implements IDisposable interface
public void Dispose()
Dispose(bool)
Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
protected override void Dispose(bool disposing)
Parameters
disposing
boolIf disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
DisposeObject()
Release the unmanaged resources
protected abstract void DisposeObject()
~UnmanagedVector()
Destructor
protected ~UnmanagedVector()
Flush()
public override void Flush()
Read(byte[], int, int)
public override int Read(byte[] buffer, int offset, int count)
Parameters
Returns
ReleaseManagedResources()
Release the managed resources. This function will be called during the disposal of the current object. override ride this function if you need to call the Dispose() function on any managed IDisposable object created by the current object
protected virtual void ReleaseManagedResources()
Seek(long, SeekOrigin)
public override long Seek(long offset, SeekOrigin origin)
Parameters
offset
longorigin
SeekOrigin
Returns
SetLength(long)
public override void SetLength(long value)
Parameters
value
long
Write(byte[], int, int)
public override void Write(byte[] buffer, int offset, int count)
Parameters
Operators
implicit operator nint(UnmanagedVector)
Implicit operator for IntPtr
public static implicit operator nint(UnmanagedVector obj)
Parameters
obj
UnmanagedVectorThe UnmanagedObject
Returns
- nint
The unmanaged pointer for this object