public void Parse(Stream hs) { NumFiles = hs.ReadDecodedUInt64(); while (true) { PropertyID propertyID = GetPropertyID(this, hs); if (propertyID == PropertyID.kEnd) { break; } FileProperty property = null; switch (propertyID) { case PropertyID.kEmptyStream: property = new PropertyEmptyStream(NumFiles); property.Parse(hs); NumEmptyStreams = (property as PropertyEmptyStream).NumEmptyStreams; break; case PropertyID.kEmptyFile: property = new PropertyEmptyFile(NumFiles, NumEmptyStreams); property.Parse(hs); break; case PropertyID.kAnti: property = new PropertyAnti(NumFiles, NumEmptyStreams); property.Parse(hs); break; case PropertyID.kCTime: case PropertyID.kATime: case PropertyID.kMTime: property = new PropertyTime(propertyID, NumFiles); property.Parse(hs); break; case PropertyID.kName: property = new PropertyName(NumFiles); property.Parse(hs); break; case PropertyID.kWinAttributes: property = new PropertyAttributes(NumFiles); property.Parse(hs); break; case PropertyID.kDummy: property = new PropertyDummy(); property.Parse(hs); break; default: throw new NotImplementedException(propertyID.ToString()); } if (property != null) { Properties.Add(property); } } }