Exemplo n.º 1
0
        private EntryList RawRead()
        {
            Stream f = new GZipStream(new FileStream(this.statefile, FileMode.Open), CompressionMode.Decompress);

            try
            {
                IFormatter formatter = this.CreateFormatter();
                object[,] raw = formatter.Deserialize(f) as object[, ];
                if (raw == null)
                {
                    return(null);
                }
                return(EntryList.Import(raw));
            }
            catch (Exception e)
            {
                DateTime n = DateTime.Now;
                File.Move(this.statefile, this.statefile + ".failed-" + n.ToString("yyyyMMddHHmmss"));
                return(null);
            }
            finally
            {
                f.Close();
            }
        }