Exemplo n.º 1
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);
        }
        // Token: 0x0600131F RID: 4895 RVA: 0x0006E8E8 File Offset: 0x0006CAE8
        public OABFile GenerateTemplateFile(FileSet fileSet)
        {
            int templateEncoding = 0;

            if (!this.TryGetLcidFromContainerName(out templateEncoding))
            {
                return(null);
            }
            FileStream fileStream = fileSet.Create("TPL");

            this.oabFile = new OABFile(fileStream, this.oabDataFileType);
            using (IOCostStream iocostStream = new IOCostStream(new NoCloseStream(fileStream)))
            {
                using (new FileSystemPerformanceTracker("GenerateOrLinkTemplateFiles.GenerateTemplateFiles", iocostStream, this.stats))
                {
                    this.SetTemplateEncoding(templateEncoding);
                    this.WriteHeader(iocostStream);
                    this.GenerateAddressTemplates(iocostStream);
                    this.GenerateDisplayTemplates(iocostStream);
                }
            }
            this.oabFile.Compress(fileSet, this.stats, "GenerateOrLinkTemplateFiles.GenerateTemplateFiles");
            return(this.oabFile);
        }
Exemplo n.º 3
0
 // Token: 0x06001335 RID: 4917 RVA: 0x0006F7C4 File Offset: 0x0006D9C4
 public AddressListFileGenerator(ADObjectId addressList, OABFile addressListFile, PropertyManager propertyManager, FileSet fileSet, GenerationStats stats, Action abortProcessingOnShutdown)
 {
     this.addressListFile           = addressListFile;
     this.propertyManager           = propertyManager;
     this.fileSet                   = fileSet;
     this.stats                     = stats;
     this.abortProcessingOnShutdown = abortProcessingOnShutdown;
     this.adAddressListEnumerator   = ADAddressListEnumerator.Create(addressList, this.stats.OfflineAddressBook.OrganizationId, this.propertyManager.PropertyDefinitions, Globals.ADQueryPageSize, this.stats);
     this.firstPage                 = true;
     this.tempFiles                 = new List <FileStream>();
 }