ArrayExtensionsCombineT(T, Int32, Int32, T, Int32, Int32) Method

Combines specified portions of arrays together into a single array.

Definition

Namespace: Gemstone.ArrayExtensions
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.110 -- Release Build+3e0464f4461df4d3e1175b13966eb47ff832554d
public static T[] Combine<T>(
	this T[] source,
	int sourceOffset,
	int sourceCount,
	T[] other,
	int otherOffset,
	int otherCount
)

Parameters

source  T
Source array.
sourceOffset  Int32
Offset into source array to begin copy.
sourceCount  Int32
Number of bytes to copy from source array.
other  T
Other array to combine to source array.
otherOffset  Int32
Offset into other array to begin copy.
otherCount  Int32
Number of bytes to copy from other array.

Type Parameters

T
Type of array.

Return Value

T
Combined specified portions of both arrays.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type T. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

Only use this function if you need a copy of the combined arrays, it will be optimal to use the Linq function ConcatTSource(IEnumerableTSource, IEnumerableTSource) if you simply need to iterate over the combined arrays.

This function can easily throw an out of memory exception if there is not enough contiguous memory to create an array sized with the combined lengths.

Exceptions

ArgumentOutOfRangeExceptionsourceOffset or otherOffset is outside the range of valid indexes for the associated array -or- sourceCount or otherCount is less than 0 -or- sourceOffset or otherOffset, and sourceCount or otherCount do not specify a valid section in the associated array.

See Also