PeterAlfreadLee commented on issue #83: COMPRESS-342 random access of 7z files URL: https://github.com/apache/commons-compress/pull/83#issuecomment-549645550 Modified the code a little bit: ``` // if this is called in a random access, then the content methods of previous entry may be null // the content methods should be set to methods of the first entry as it must not be null if(currentEntryIndex != entryIndex) { int folderFirstFileIndex = archive.streamMap.folderFirstFileIndex[folderIndex]; SevenZArchiveEntry folderFirstFile = archive.files[folderFirstFileIndex]; file.setContentMethods(folderFirstFile.getContentMethods()); } ``` When called in a random access, the content methods should be set to methods of the first entry in folder, instead of the methods of the previous entry in folder. That's because the content methods of the previous entry may be null as it's a random access.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
