Example #1
0
 /// <summary>
 /// Decodes a stream and saves the result to disk
 /// </summary>
 /// <param name="stream"></param>
 /// <param name="filepath"></param>
 /// <returns></returns>
 public static void DecodeAndExport(Stream stream, string filepath)
 {
     using var bt = new BlockTableStreamReader(stream);
     using var fs = Helpers.Create(filepath);
     bt.Position  = 0;
     bt.CopyTo(fs);
 }
Example #2
0
 /// <summary>
 /// Decodes a file and saves the result to disk
 /// </summary>
 /// <param name="inputPath"></param>
 /// <param name="outputPath"></param>
 /// <returns></returns>
 public static void DecodeAndExport(string inputPath, string outputPath)
 {
     using var bt = new BlockTableStreamReader(inputPath);
     using var fs = Helpers.Create(outputPath);
     bt.Position  = 0;
     bt.CopyTo(fs);
 }
Example #3
0
 /// <summary>
 /// Decodes a byte array and saves the result to disk
 /// </summary>
 /// <param name="data"></param>
 /// <param name="filepath"></param>
 /// <returns></returns>
 public static void DecodeAndExport(byte[] data, string filepath)
 {
     using (var bt = new BlockTableStreamReader(data))
         using (var fs = Helpers.Create(filepath))
         {
             bt.Position = 0;
             bt.CopyTo(fs);
         }
 }
Example #4
0
 /// <summary>
 /// Decodes a byte array and saves the result to disk
 /// </summary>
 /// <param name="data"></param>
 /// <param name="filepath"></param>
 /// <returns></returns>
 public static void DecodeAndExport(byte[] data, string filepath)
 {
     using var bt = new BlockTableStreamReader(data);
     using var fs = Helpers.Create(filepath);
     bt.Position  = 0;
     bt.CopyTo(fs);
     fs.Flush(true);
     fs.Dispose();
 }