Exemple #1
0
        // Token: 0x06000D9D RID: 3485 RVA: 0x00038DE8 File Offset: 0x00036FE8
        private void WriteHeader(uint uncompressedFileSize)
        {
            OABCompressedHeader oabcompressedHeader = new OABCompressedHeader
            {
                MaxVersion = OABCompressedHeader.DefaultMaxVersion,
                MinVersion = OABCompressedHeader.DefaultMinVersion,
                MaximumCompressionBlockSize = this.maximumCompressionBlockSize,
                UncompressedFileSize        = uncompressedFileSize
            };

            OABCompressStream.Tracer.TraceDebug <long, OABCompressedHeader>((long)this.GetHashCode(), "OABCompressStream: writing header at stream position {0}:\n\r{1}", this.stream.Position, oabcompressedHeader);
            oabcompressedHeader.WriteTo(this.writer);
        }
        // Token: 0x06000DAD RID: 3501 RVA: 0x0003902C File Offset: 0x0003722C
        private void ReadHeader()
        {
            long arg = this.reader.BaseStream.Position;

            this.header = OABCompressedHeader.ReadFrom(this.reader);
            OABDecompressStream.Tracer.TraceDebug <long, OABCompressedHeader>((long)this.GetHashCode(), "OABDecompressStream: read OABCompressedHeader at position {0}:\r\n{1}", arg, this.header);
            if (this.header.MaxVersion != OABCompressedHeader.DefaultMaxVersion)
            {
                throw new InvalidDataException(string.Format("MaxVersion: expected={0}, actual={1}", OABCompressedHeader.DefaultMaxVersion, this.header.MaxVersion));
            }
            if (this.header.MinVersion != OABCompressedHeader.DefaultMinVersion)
            {
                throw new InvalidDataException(string.Format("MinVersion: expected={0}, actual={1}", OABCompressedHeader.DefaultMinVersion, this.header.MinVersion));
            }
            this.decompressor = new DataCompression(this.header.MaximumCompressionBlockSize, this.header.MaximumCompressionBlockSize);
            this.buffer       = new ByteQueue(this.header.MaximumCompressionBlockSize);
        }