public static void WriteToFile(IByteable byteable, string fileName) { byte[] b = new byte[byteable.GetSize()]; ByteScribe writer = new ByteScribe(b); writer.Write(byteable); File.WriteAllBytes(fileName, b); }
//members must be read and written in the same order void IByteable.Write(ByteScribe writer) { writer.Write(x); writer.Write(y); }