Jeder hat etwas gleichwertig (und hübscher als) den folgenden Code?Drehen von Paaren von Bytes in Floats
private static float[] PairsOfBytesToFloats(byte[] bytes)
{
if (bytes.Length.IsNotAMultipleOf(2)) throw new ArgumentException();
float[] result = new float[bytes.Length/2];
for (int i = 0; i < bytes.Length; i += 2)
{
result[i/2] = BitConverter.ToUInt16(bytes, i);
}
return result;
}
'BitConverter.ToUInt16'? Vielleicht 'BitConverter.ToSingle'? – Dmitry