Calculates a 32bit Cyclic Redundancy Checksum (CRC) using the same polynomial used by Zip. This type is used internally by DotNetZip; it is generally not used directly by applications wishing to create, read, or manipulate zip archive files.
Beispiel #1
0
 // This ctor is private - no validation is done here.  This is to allow the use
 // of a (specific) negative value for the _lengthLimit, to indicate that there
 // is no length set.  So we validate the length limit in those ctors that use an
 // explicit param, otherwise we don't validate, because it could be our special
 // value.
 private CrcCalculatorStream(bool leaveOpen, long length, Stream stream)
 {
     this.innerStream = stream;
     this.crc32 = new Crc32();
     this.lengthLimit = length;
     this.LeaveOpen = leaveOpen;
 }
Beispiel #2
0
        public ZlibBaseStream(Stream stream, ZlibStreamFlavor flavor, bool leaveOpen)
        {
            this.FlushMode = FlushType.None;
            //_workingBuffer = new byte[WORKING_BUFFER_SIZE_DEFAULT];
            this.Stream = stream;
            this.LeaveOpen = leaveOpen;
            this.Flavor = flavor;
            // workitem 7159

            if (flavor == ZlibStreamFlavor.Gzip)
            {
                this.crc = new Crc32();
            }
        }