TryGetZip64BlockFromGenericExtraField() 개인적인 정적인 메소드

private static TryGetZip64BlockFromGenericExtraField ( ZipGenericExtraField extraField, bool readUncompressedSize, bool readCompressedSize, bool readLocalHeaderOffset, bool readStartDiskNumber, Zip64ExtraField &zip64Block ) : bool
extraField ZipGenericExtraField
readUncompressedSize bool
readCompressedSize bool
readLocalHeaderOffset bool
readStartDiskNumber bool
zip64Block Zip64ExtraField
리턴 bool
예제 #1
0
        public static Zip64ExtraField GetAndRemoveZip64Block(List <ZipGenericExtraField> extraFields, bool readUncompressedSize, bool readCompressedSize, bool readLocalHeaderOffset, bool readStartDiskNumber)
        {
            Zip64ExtraField zip64ExtraField = new Zip64ExtraField()
            {
                _compressedSize    = null,
                _uncompressedSize  = null,
                _localHeaderOffset = null,
                _startDiskNumber   = null
            };
            List <ZipGenericExtraField> zipGenericExtraFields = new List <ZipGenericExtraField>();
            bool flag = false;

            foreach (ZipGenericExtraField extraField in extraFields)
            {
                if (extraField.Tag != 1)
                {
                    continue;
                }
                zipGenericExtraFields.Add(extraField);
                if (flag || !Zip64ExtraField.TryGetZip64BlockFromGenericExtraField(extraField, readUncompressedSize, readCompressedSize, readLocalHeaderOffset, readStartDiskNumber, out zip64ExtraField))
                {
                    continue;
                }
                flag = true;
            }
            foreach (ZipGenericExtraField zipGenericExtraField in zipGenericExtraFields)
            {
                extraFields.Remove(zipGenericExtraField);
            }
            return(zip64ExtraField);
        }
예제 #2
0
        public static Zip64ExtraField GetJustZip64Block(Stream extraFieldStream, bool readUncompressedSize, bool readCompressedSize, bool readLocalHeaderOffset, bool readStartDiskNumber)
        {
            Zip64ExtraField      zip64ExtraField;
            ZipGenericExtraField zipGenericExtraField;
            Zip64ExtraField      zip64ExtraField1;

            using (BinaryReader binaryReader = new BinaryReader(extraFieldStream))
            {
                while (ZipGenericExtraField.TryReadBlock(binaryReader, extraFieldStream.Length, out zipGenericExtraField))
                {
                    if (!Zip64ExtraField.TryGetZip64BlockFromGenericExtraField(zipGenericExtraField, readUncompressedSize, readCompressedSize, readLocalHeaderOffset, readStartDiskNumber, out zip64ExtraField))
                    {
                        continue;
                    }
                    zip64ExtraField1 = zip64ExtraField;
                    return(zip64ExtraField1);
                }
                zip64ExtraField = new Zip64ExtraField()
                {
                    _compressedSize    = null,
                    _uncompressedSize  = null,
                    _localHeaderOffset = null,
                    _startDiskNumber   = null
                };
                return(zip64ExtraField);
            }
            return(zip64ExtraField1);
        }