this.Files.clear();
this.Files.ensureCapacity(numFiles);
for (int i=0; i<numFiles; i++)
this.Files.add(new FileItem());
BoolVector emptyStreamVector = new BoolVector();
emptyStreamVector.Reserve(numFiles);
for(int i = 0; i < numFiles; i++)
emptyStreamVector.add(false);
BoolVector emptyFileVector = new BoolVector();
BoolVector antiFileVector = new BoolVector();
int numEmptyStreams = 0;
long type;
while ((type = this.inStream.ReadID()) != Header.NID.kEnd) {
long size = this.inStream.ReadNumber();
this.ArchiveInfo.FileInfoPopIDs.add(type);
switch((int)type) {
case Header.NID.kEmptyStream:
emptyStreamVector.setBoolVector(this.inStream.ReadBoolVector(numFiles));
for (int i=0; i<emptyStreamVector.size(); i++)
if (emptyStreamVector.get(i))
numEmptyStreams++;
emptyFileVector.Reserve(numEmptyStreams);
antiFileVector.Reserve(numEmptyStreams);
for (int i = 0; i < numEmptyStreams; i++) {
emptyFileVector.add(false);
antiFileVector.add(false);
}
break;
case Header.NID.kName: this.ReadFileNames(dataVector); break;
case Header.NID.kWinAttributes: this.ReadFileAttributes(dataVector); break;
case Header.NID.kStartPos: this.ReadFileStartPositions(dataVector); break;
case Header.NID.kEmptyFile: emptyFileVector.setBoolVector(this.inStream.ReadBoolVector(numEmptyStreams)); break;
case Header.NID.kAnti: antiFileVector.setBoolVector(this.inStream.ReadBoolVector(numEmptyStreams)); break;
case Header.NID.kCreationTime:
case Header.NID.kLastWriteTime:
case Header.NID.kLastAccessTime: this.ReadTime(dataVector, type); break;
default:
this.ArchiveInfo.FileInfoPopIDs.DeleteBack();
this.inStream.SkeepData(size);
break;
}
}
int emptyFileIndex = 0;
int sizeIndex = 0;
for(int i = 0; i < numFiles; i++) {
FileItem file = (FileItem)this.Files.get(i);
file.HasStream = !emptyStreamVector.get(i);
if(file.HasStream) {
file.IsDirectory = false;
file.IsAnti = false;
file.UnPackSize = unPackSizes.get(sizeIndex);
file.FileCRC = digests.get(sizeIndex);
file.IsFileCRCDefined = digestsDefined.get(sizeIndex);
sizeIndex++;
} else {
file.IsDirectory = !emptyFileVector.get(emptyFileIndex);
file.IsAnti = antiFileVector.get(emptyFileIndex);
emptyFileIndex++;
file.UnPackSize = 0;
file.IsFileCRCDefined = false;
}
}