public void GenerateBinaryData(VexObject vo, string path, out string filename) { string dataName = vo.Name + "Data"; filename = path + dataName + ".dat"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } FileStream stream = new FileStream(filename, FileMode.Create); VexDrawWriter writer = new VexDrawWriter(stream); DrawObject drawObject = new DrawObject(vo); writer.WriteDrawObject(drawObject); stream.Flush(); //byte[] bytes = stream.ToArray(); stream.Close(); }