Edit

Share via


UnmanagedMemoryAccessor.ReadArray<T>(Int64, T[], Int32, Int32) Method

Definition

Reads structures of type T from the accessor into an array of type T.

public:
generic <typename T>
 where T : value class int ReadArray(long position, cli::array <T> ^ array, int offset, int count);
public int ReadArray<T> (long position, T[] array, int offset, int count) where T : struct;
[System.Security.SecurityCritical]
public int ReadArray<T> (long position, T[] array, int offset, int count) where T : struct;
member this.ReadArray : int64 * 'T[] * int * int -> int (requires 'T : struct)
[<System.Security.SecurityCritical>]
member this.ReadArray : int64 * 'T[] * int * int -> int (requires 'T : struct)
Public Function ReadArray(Of T As Structure) (position As Long, array As T(), offset As Integer, count As Integer) As Integer

Type Parameters

T

The type of structure.

Parameters

position
Int64

The number of bytes in the accessor at which to begin reading.

array
T[]

The array to contain the structures read from the accessor.

offset
Int32

The index in array in which to place the first copied structure.

count
Int32

The number of structures of type T to read from the accessor.

Returns

The number of structures read into array. This value can be less than count if there are fewer structures available, or zero if the end of the accessor is reached.

Attributes

Exceptions

array is not large enough to contain count of structures (starting from position).

array is null.

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

This method is not safe.

Applies to