This documentation is archived and is not being maintained.

UnmanagedMemoryAccessor.ReadArray<T> Method

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

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

public int ReadArray<T>(
	long position,
	T[] array,
	int offset,
	int count
where T : struct

Type Parameters


The type of structure.


Type: System.Int64
The number of bytes in the accessor at which to begin reading.
Type: T[]
The array to contain the structures read from the accessor.
Type: System.Int32
The index in array in which to place the first copied structure.
Type: System.Int32
The number of structures of type T to read from the accessor.

Return Value

Type: System.Int32
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.


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.

This method is not safe.

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

  • SecurityCriticalAttribute 

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

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.