public static int Ebml_Read_Float(this BinaryReader reader, int size, out double num)
{
if (size == 0)
num = 0;
else if (size == 4)
{
byte[] floatBytes = reader.ReadBytes(4);
Array.Reverse(floatBytes);
num = BitConverter.ToSingle(floatBytes, 0);
}
else if (size == 8)
{
byte[] dBytes = reader.ReadBytes(8);
Array.Reverse(dBytes);
num = BitConverter.ToDouble(dBytes, 0);
}
else
throw new ArgumentException("Invalid size");
return 0;
}