public byte[] Serialize(YaffsImage Image) { using (TemporaryDirectory expansion = _expander.SaveImageToDirectory(Image)) { MkYaffs2Tool yaffsTool = _yaffsToolFactory.GetTool(); byte[] imageData = yaffsTool.GetYaffsImage(expansion.DirectoryInfo); return imageData; } }
public TemporaryDirectory SaveImageToDirectory(YaffsImage Image) { var root = new DirectoryInfo(Path.Combine(Path.GetTempPath(), string.Format("Burner Temporary Yaffs Directory {0}", Guid.NewGuid()))); root.Create(); var expandingContext = new ExpandingContext(_fileModeManagerFactory.GetFileModeManager(root.FullName), _fileOwnerManagerFactory.GetFileOwnerManager(root.FullName)); foreach (YaffsEntry child in Image.Root.Children) expandingContext.ExpandChild(root, child); return new TemporaryDirectory(root); }
public byte[] Serialize(YaffsImage Image) { return new byte[0]; }