// Token: 0x060012BB RID: 4795 RVA: 0x0006D118 File Offset: 0x0006B318
        public OABFile GenerateDiffFile(FileSet fileSet)
        {
            this.abortProcessingOnShutdown();
            FileStream fileStream = fileSet.Create("CHG");

            this.diffFile = new OABFile(fileStream, OABDataFileType.Diff);
            bool flag = false;

            using (IOCostStream iocostStream = new IOCostStream(new NoCloseStream(fileStream)))
            {
                using (new FileSystemPerformanceTracker("FinishGeneratingAddressListFiles.GenerateDiffFiles", iocostStream, this.stats))
                {
                    flag = this.CreatePatch(iocostStream);
                }
            }
            if (flag)
            {
                this.diffFile.SequenceNumber     = (this.newFile.SequenceNumber += 1U);
                this.diffFile.DnToUseInOABFile   = this.newFile.DnToUseInOABFile;
                this.diffFile.NameToUseInOABFile = this.newFile.NameToUseInOABFile;
                this.diffFile.Guid = this.newFile.Guid;
                this.diffFile.UncompressedFileSize = this.newFile.UncompressedFileSize;
                this.diffFile.CompressedFileSize   = (uint)this.diffFile.UncompressedFileStream.Length;
                this.diffFile.CompressedFileHash   = OABFileHash.GetHash(this.diffFile.UncompressedFileStream);
                return(this.diffFile);
            }
            this.diffFile = null;
            return(null);
        }
예제 #2
0
        // Token: 0x060012EA RID: 4842 RVA: 0x0006E048 File Offset: 0x0006C248
        public bool IsPublished(string oabDirectory)
        {
            FileInfo fileInfo = new FileInfo(Path.Combine(oabDirectory, this.PublishedFileName));

            if (fileInfo.Exists && fileInfo.Length == (long)((ulong)this.CompressedFileSize))
            {
                using (Stream stream = File.Open(fileInfo.FullName, FileMode.Open, FileAccess.Read))
                {
                    if (this.CompressedFileHash == OABFileHash.GetHash(stream))
                    {
                        return(true);
                    }
                }
                return(false);
            }
            return(false);
        }
예제 #3
0
        // Token: 0x060012EB RID: 4843 RVA: 0x0006E0C4 File Offset: 0x0006C2C4
        public void Compress(FileSet fileSet, GenerationStats stats, string marker)
        {
            this.compressedFileStream = fileSet.Create("LZX");
            long  length = this.uncompressedFileStream.Length;
            ulong num    = (ulong)-1;

            this.uncompressedFileSize = (uint)this.uncompressedFileStream.Length;
            this.uncompressedFileStream.Seek(0L, SeekOrigin.Begin);
            Stopwatch stopwatch = Stopwatch.StartNew();

            byte[] array = new byte[Globals.MaxCompressionBlockSize];
            using (IOCostStream iocostStream = new IOCostStream(new NoCloseStream(this.uncompressedFileStream)))
            {
                using (new FileSystemPerformanceTracker(marker, iocostStream, stats))
                {
                    using (IOCostStream iocostStream2 = new IOCostStream(new OABCompressStream(this.compressedFileStream, Globals.MaxCompressionBlockSize)))
                    {
                        using (new FileSystemPerformanceTracker(marker, iocostStream2, stats))
                        {
                            for (;;)
                            {
                                int num2 = iocostStream.Read(array, 0, array.Length);
                                if (num2 == 0)
                                {
                                    break;
                                }
                                iocostStream2.Write(array, 0, num2);
                            }
                        }
                    }
                }
            }
            stopwatch.Stop();
            this.ioDuration        += stopwatch.Elapsed;
            this.compressedFileSize = (uint)this.compressedFileStream.Length;
            this.compressedFileHash = OABFileHash.GetHash(this.compressedFileStream);
        }