Skip to content

Instantly share code, notes, and snippets.

@ArcticEcho
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArcticEcho/923af766f79a5b0ddd88 to your computer and use it in GitHub Desktop.
Save ArcticEcho/923af766f79a5b0ddd88 to your computer and use it in GitHub Desktop.
public ReportLog()
{
byte[] uncompBytes;
using (var file = File.OpenRead(path))
using (var compStrm = new GZipStream(file, CompressionMode.Decompress))
{
uncompBytes = new byte[file.Length];
var strm = new MemoryStream();
compStrm.CopyTo(strm);
strm.Read(uncompBytes, 0, (int)compStrm.Length);
}
log = Newtonsoft.Json.JsonConvert.DeserializeObject<List<LogItem>>(Encoding.UTF8.GetString(uncompBytes));
if (log == null)
{
log = new List<LogItem>();
}
GlobalInfo.PostsCaught += log.Count;
writer = new Thread(UpdateLog);
writer.Start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment