UnmanagedMemoryAccessor.Read(Int64, T) UnmanagedMemoryAccessor.Read(Int64, T) UnmanagedMemoryAccessor.Read(Int64, T) UnmanagedMemoryAccessor.Read(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);
[System.Security.SecurityCritical]
public void Read<T> (long position, out T structure) where T : struct;
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 Int64 Int64 Int64

The position in the accessor at which to begin reading.

structure

The structure to contain the read data.

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.

Remarks

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

Security

SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Applies to