예제 #1
0
        public CheckPointResponse(Stream s) : base(s)
        {
            MemoryStream unCompressed;

            using (BinaryReader br = new BinaryReader(s, Encoding.Default, true)) {
                CheckPointResponseMagic = ByteString.ReadFromStream(br);
                Version          = br.ReadUInt16();
                UncompressedSize = br.ReadUInt32();
                CompressedSize   = br.ReadUInt32();
                DecompressData(br.ReadBytes((int)CompressedSize), out byte[] decompressed);
                unCompressed = new MemoryStream(decompressed);
            }
            unCompressed.Position = 0;
            CheckPoint            = new CheckPoint(unCompressed);
            unCompressed.Dispose();
            //Node.Instance.CheckPoint.Append(CheckPoint);
            CheckPoint.Dispose();
            CheckPoint = null;
        }