(Dump): convenient class for tracing/debugging.

This commit is contained in:
morkt 2015-08-03 22:26:26 +04:00
parent a9375e777e
commit dd3d87aff7

View File

@ -401,4 +401,16 @@ namespace GameRes.Formats
System.GC.SuppressFinalize (this);
}
}
public static class Dump
{
public static string DirectoryName = Environment.GetFolderPath (Environment.SpecialFolder.UserProfile);
[System.Diagnostics.Conditional("DEBUG")]
public static void Write (byte[] mem, string filename = "index.dat")
{
using (var dump = File.Create (Path.Combine (DirectoryName, filename)))
dump.Write (mem, 0, mem.Length);
}
}
}