#### [Abblix\.Utils](https://www.abblix.com/en/docs/api/abblix-utils 'index')
### [Abblix\.Utils](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils 'Abblix\.Utils')

## ArrayExtensions Class

Allocation\-explicit array helpers: each operation returns a freshly allocated array sized to the result\.
Prefer these over LINQ when the caller needs a concrete `T[]` without an extra `ToArray()` step,
or when copying byte buffers via [System\.Buffer\.BlockCopy\(System\.Array,System\.Int32,System\.Array,System\.Int32,System\.Int32\)](https://learn.microsoft.com/en-us/dotnet/api/system.buffer.blockcopy#system-buffer-blockcopy(system-array-system-int32-system-array-system-int32-system-int32) 'System\.Buffer\.BlockCopy\(System\.Array,System\.Int32,System\.Array,System\.Int32,System\.Int32\)') matters\.

```csharp
public static class ArrayExtensions
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → ArrayExtensions
### Methods

## ArrayExtensions\.Append\<T\>\(this T\[\], T\) Method {#Abblix.Utils.ArrayExtensions.Append_T_(thisT[],T)}

Appends a value to the end of an array\.

```csharp
public static T[] Append<T>(this T[] array, T value);
```
#### Type parameters

###### `T` {#Abblix.Utils.ArrayExtensions.Append_T_(thisT[],T).T}

The type of the elements in the array\.
#### Parameters

###### `array` [T](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils.ArrayExtensions#Abblix.Utils.ArrayExtensions.Append_T_(thisT[],T).T 'Abblix\.Utils\.ArrayExtensions\.Append\<T\>\(this T\[\], T\)\.T')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array') {#Abblix.Utils.ArrayExtensions.Append_T_(thisT[],T).array}

The array to append to\.

###### `value` [T](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils.ArrayExtensions#Abblix.Utils.ArrayExtensions.Append_T_(thisT[],T).T 'Abblix\.Utils\.ArrayExtensions\.Append\<T\>\(this T\[\], T\)\.T') {#Abblix.Utils.ArrayExtensions.Append_T_(thisT[],T).value}

The value to append\.

#### Returns
[T](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils.ArrayExtensions#Abblix.Utils.ArrayExtensions.Append_T_(thisT[],T).T 'Abblix\.Utils\.ArrayExtensions\.Append\<T\>\(this T\[\], T\)\.T')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array')  
A new array with the value appended\.

### Remarks
This method creates a new array with a size larger by one than the original array,
copies all elements from the original array, and adds the specified value at the end\.

## ArrayExtensions\.Concat\(byte\[\]\[\]\) Method {#Abblix.Utils.ArrayExtensions.Concat(byte[][])}

Concatenates multiple byte arrays into a single array\.

```csharp
public static byte[] Concat(params byte[][] arrays);
```
#### Parameters

###### `arrays` [System\.Byte](https://learn.microsoft.com/en-us/dotnet/api/system.byte 'System\.Byte')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array') {#Abblix.Utils.ArrayExtensions.Concat(byte[][]).arrays}

The arrays to concatenate\.

#### Returns
[System\.Byte](https://learn.microsoft.com/en-us/dotnet/api/system.byte 'System\.Byte')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array')  
A new array containing all input arrays concatenated in order\.

### Remarks
Uses Buffer\.BlockCopy for efficient byte\-level copying\.
Returns empty array if no arrays are provided\.

## ArrayExtensions\.Concat\(this byte\[\], byte\[\]\) Method {#Abblix.Utils.ArrayExtensions.Concat(thisbyte[],byte[])}

Concatenates two byte arrays into a single array\.

```csharp
public static byte[] Concat(this byte[] first, byte[] second);
```
#### Parameters

###### `first` [System\.Byte](https://learn.microsoft.com/en-us/dotnet/api/system.byte 'System\.Byte')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array') {#Abblix.Utils.ArrayExtensions.Concat(thisbyte[],byte[]).first}

The first array\.

###### `second` [System\.Byte](https://learn.microsoft.com/en-us/dotnet/api/system.byte 'System\.Byte')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array') {#Abblix.Utils.ArrayExtensions.Concat(thisbyte[],byte[]).second}

The second array\.

#### Returns
[System\.Byte](https://learn.microsoft.com/en-us/dotnet/api/system.byte 'System\.Byte')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array')  
A new array containing all elements from both arrays in order\.

### Remarks
Uses Buffer\.BlockCopy for efficient byte\-level copying\.

## ArrayExtensions\.Prepend\<T\>\(this T\[\], T\) Method {#Abblix.Utils.ArrayExtensions.Prepend_T_(thisT[],T)}

Prepends a value to the beginning of an array\.

```csharp
public static T[] Prepend<T>(this T[] array, T value);
```
#### Type parameters

###### `T` {#Abblix.Utils.ArrayExtensions.Prepend_T_(thisT[],T).T}

The type of the elements in the array\.
#### Parameters

###### `array` [T](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils.ArrayExtensions#Abblix.Utils.ArrayExtensions.Prepend_T_(thisT[],T).T 'Abblix\.Utils\.ArrayExtensions\.Prepend\<T\>\(this T\[\], T\)\.T')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array') {#Abblix.Utils.ArrayExtensions.Prepend_T_(thisT[],T).array}

The array to prepend to\.

###### `value` [T](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils.ArrayExtensions#Abblix.Utils.ArrayExtensions.Prepend_T_(thisT[],T).T 'Abblix\.Utils\.ArrayExtensions\.Prepend\<T\>\(this T\[\], T\)\.T') {#Abblix.Utils.ArrayExtensions.Prepend_T_(thisT[],T).value}

The value to prepend\.

#### Returns
[T](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils.ArrayExtensions#Abblix.Utils.ArrayExtensions.Prepend_T_(thisT[],T).T 'Abblix\.Utils\.ArrayExtensions\.Prepend\<T\>\(this T\[\], T\)\.T')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array')  
A new array with the value prepended\.

### Remarks
This method creates a new array with a size larger by one than the original array,
copies all elements from the original array starting from the second position,
and adds the specified value at the beginning\.
