Last active
August 29, 2015 14:12
-
-
Save ArcticEcho/923af766f79a5b0ddd88 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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