Пример #1
0
        static public List <ZipGenericExtraField> GetExtraFields(BinaryReader reader)
        {
            //assumes that TrySkipBlock has already been called, so we don't have to validate twice

            List <ZipGenericExtraField> result;

            const Int32 OffsetToFilenameLength = 26; //from the point before the signature

            reader.BaseStream.Seek(OffsetToFilenameLength, SeekOrigin.Current);

            UInt16 filenameLength   = reader.ReadUInt16();
            UInt16 extraFieldLength = reader.ReadUInt16();

            reader.BaseStream.Seek(filenameLength, SeekOrigin.Current);


            using (Stream str = new SubReadStream(reader.BaseStream, reader.BaseStream.Position, extraFieldLength))
            {
                result = ZipGenericExtraField.ParseExtraField(str);
            }
            Zip64ExtraField.RemoveZip64Blocks(result);

            return(result);
        }