public void Write(Stream stream, ICanvas canvas) { var idReset = new IdReset(); idReset.Reset(canvas); var idPreprocessor = new IdPreprocessor(); var bpoints = idPreprocessor.Process(canvas); var canvasWriter = new CanvasWriter(); using (var writer = new BinaryWriter(stream)) { canvasWriter.Write(writer, ref bpoints, canvas); idReset.Reset(canvas); } }
public ICanvas Read(Stream stream) { var idReset = new IdReset(); var canvasReader = new CanvasReader(); using (var reader = new BinaryReader(stream)) { var canvas = canvasReader.Read(reader); idReset.Reset(canvas); return(canvas); } }
public ICanvas Read(Stream stream) { var idReset = new IdReset(); var canvasReader = new CanvasReader(); using (var reader = new BinaryReader(stream)) { var canvas = canvasReader.Read(reader); idReset.Reset(canvas); return canvas; } }
public void Write(Stream stream, ICanvas canvas) { var idReset = new IdReset(); idReset.Reset(canvas); var idPreprocessor = new IdPreprocessor(); var bpoints = idPreprocessor.Process(canvas); var canvasWriter = new CanvasWriter(); using (var writer = new BinaryWriter(stream)) { canvasWriter.Write(writer, ref bpoints, canvas); idReset.Reset(canvas); } }