Del via


ArrayRecord.GetArray(Type, Boolean) Method

Definition

Allocates an array and fills it with the data provided in the serialized records (in case of primitive types like String or Int32) or the serialized records themselves.

public Array GetArray(Type expectedArrayType, bool allowNulls = true);
member this.GetArray : Type * bool -> Array
Public Function GetArray (expectedArrayType As Type, Optional allowNulls As Boolean = true) As Array

Parameters

expectedArrayType
Type

Expected array type.

allowNulls
Boolean

true to permit null values within the array; otherwise, false.

Returns

An array filled with the data provided in the serialized records.

Exceptions

expectedArrayType does not match the data from the payload.

Remarks

Check the total length of the array by using Lengths property before calling this method, as an attacker could have sent you a small payload that will require to allocate a very large array and potentially cause OutOfMemoryException and Denial of Service.

Applies to