Rediger

Del via


UnmanagedMemoryAccessor.Read<T>(Int64, T) Method

Definition

Reads a structure of type T from the accessor into a provided reference.

public:
generic <typename T>
 where T : value class void Read(long position, [Runtime::InteropServices::Out] T % structure);
public void Read<T> (long position, out T structure) where T : struct;
[System.Security.SecurityCritical]
public void Read<T> (long position, out T structure) where T : struct;
member this.Read : int64 * 'T -> unit (requires 'T : struct)
[<System.Security.SecurityCritical>]
member this.Read : int64 * 'T -> unit (requires 'T : struct)
Public Sub Read(Of T As Structure) (position As Long, ByRef structure As T)

Type Parameters

T

The type of structure.

Parameters

position
Int64

The position in the accessor at which to begin reading.

structure
T

The structure to contain the read data.

Attributes

Exceptions

There are not enough bytes after position to read in a structure of type T.

-or-

T is a value type that contains one or more reference types.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support reading.

The accessor has been disposed.

Remarks

Use this method to read medium to large structures that are not easily accommodated by the other read methods in this class.

Applies to