public static void writeDouble(double value, BinaryWriter writer) { byte[] bytes = BitConverter.GetBytes(value); writer.Write(bytes); }