.. _doxcsid-class_p1_1_1_camera_sdk_1_1_native_memory_ref: NativeMemoryRef Class ~~~~~~~~~~~~~~~~~~~~~ Definition ^^^^^^^^^^ *Namespace:* ``P1.CameraSdk`` A wrapper around a temporary reference to an block of unmanaged memory :ref:`More...` .. ref-code-block:: csharp :class: doxyrest-overview-code-block public class NativeMemoryRef : Stream .. _csdetails-class_p1_1_1_camera_sdk_1_1_native_memory_ref: Remarks ^^^^^^^ A wrapper around a temporary reference to an block of unmanaged memory This object references memory owned by the SDK subsystem, so you *must* :ref:`Dispose() ` it as soon as you are done with it. Either manually call :ref:`Dispose() ` or use a .. code-block:: none using block to ensure quick disposal of the referenced memory. (Do *not* rely on the garbage collector to eventually free the object. Since the lower layers of this :ref:`Camera ` SDK are written in C/C++, images are returned to CLR contexts as a reference to unmanaged memory. This allows you to avoid extranous copies of the image data. This class implements the Stream abstract class, so you can easily stream its content to a file or other destination stream. The method :ref:`ToArray ` copies the entire data buffer into a byte array ( .. code-block:: none byte[] ). This effectively transfers (copies) the data from unmanaged memory into managed. .. rubric:: See also: :ref:`Camera.WaitForImage(uint) `, Camera.WaitForLiveView(uint) Properties ^^^^^^^^^^ .. toctree:: :hidden: Size Pointer Position CanRead CanSeek CanWrite Length .. list-table:: :widths: 30 70 * - :ref:`Size ` - * - :ref:`Pointer ` - * - :ref:`Position ` - * - :ref:`CanRead ` - * - :ref:`CanSeek ` - * - :ref:`CanWrite ` - * - :ref:`Length ` - Methods ^^^^^^^ .. toctree:: :hidden: Flush Read Seek SetLength Write ToArray Dispose .. list-table:: :widths: 33 67 * - :ref:`Flush() ` - * - :ref:`Read(byte[] buffer, int offset, int count) ` - * - :ref:`Seek(long offset, SeekOrigin origin) ` - * - :ref:`SetLength(long value) ` - * - :ref:`Write(byte[] buffer, int offset, int count) ` - * - :ref:`ToArray() ` - * - :ref:`Dispose() ` -