¿Equivalente en C # de "struct.pack / unpack" de Python?

Soy un desarrollador experimentado de Python y he llegado a amar muchas de sus comodidades. En realidad, conozco C # desde hace algún tiempo, pero recientemente me he metido en una codificación más avanzada.

Lo que me pregunto es si hay una manera de "analizar" una matriz de bytes en C # en un conjunto de elementos (de diferente tamaño).

Imagina que tenemos esto:

Pitón:

import struct
byteArray = "\xFF\xFF\x00\x00\x00\xFF\x01\x00\x00\x00"
numbers = struct.unpack("<LHL",byteArray)
print numbers[0] # 65535
print numbers[1] # 255
print numbers[2] # 1

newNumbers = [0, 255, 1023]
byteArray = struct.pack("<HHL",newNumbers)
print byteArray # '\x00\x00\xFF\x00\xFF\x03\x00\x00'

Quiero lograr el mismo efecto en C #, sin recurrir a cantidades enormes y desordenadas de código como este:

C#:

byte[] byteArray = new byte[] { 255, 255, 0, 0, 0, 255, 1, 0, 0, 0 };
byte[] temp;

int[] values = new int[3];

temp = new byte[4];
Array.Copy(byteArray, 0, temp, 0, 4);
values[0] = BitConverter.ToInt32(temp);

temp = new byte[2];
Array.Copy(byteArray, 4, temp, 0, 2);
values[1] = BitConverter.ToInt16(temp);

temp = new byte[4];
Array.Copy(byteArray, 8, temp, 0, 4);
values[2] = BitConverter.ToInt32(temp);

// Now values contains an array of integer values.
// It would be OK to assume a common maximum (e.g. Int64) and just cast up to that,
// but we still have to consider the size of the source bytes.

// Now the other way.
int[] values = new int[] { 0, 255, 1023 };
byteArray = new byte[8];

temp = BitConverter.GetBytes(values[0]);
Array.Copy(temp,2,byteArray,0,2);

temp = BitConverter.GetBytes(values[1]);
Array.Copy(temp,2,byteArray,2,2);

temp = BitConverter.GetBytes(values[2]);
Array.Copy(temp,0,byteArray,4,4);

Obviamente el código C # que tengo esmuy específico y de ninguna manera verdaderamente reutilizable.

¿Consejo?

Respuestas a la pregunta(3)

Su respuesta a la pregunta