[
https://issues.apache.org/jira/browse/COMPRESS-505?focusedWorklogId=398882&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-398882
]
ASF GitHub Bot logged work on COMPRESS-505:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 06/Mar/20 02:43
Start Date: 06/Mar/20 02:43
Worklog Time Spent: 10m
Work Description: coveralls commented on issue #95: COMPRESS-505 : bug
fix for random access of 7z
URL: https://github.com/apache/commons-compress/pull/95#issuecomment-595094303
[](https://coveralls.io/builds/29168678)
Coverage increased (+0.04%) to 87.039% when pulling
**ccf4f3d856f4ec7f62644bf0a8e0ad6bc155b1f9 on PeterAlfreadLee:COMPRESS-505**
into **1e8d131ec08ae418f0140d8166d452dff6739937 on apache:master**.
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 398882)
Time Spent: 0.5h (was: 20m)
> Multiple Reads of One SevenZArchiveEntry Fails
> ----------------------------------------------
>
> Key: COMPRESS-505
> URL: https://issues.apache.org/jira/browse/COMPRESS-505
> Project: Commons Compress
> Issue Type: Bug
> Affects Versions: 1.20
> Reporter: Steven Fontaine
> Priority: Minor
> Attachments: CC0 Images.7z
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> I've run into a bug which occurs when attempting to read the same
> SevenZArchiveEntry stream multiple times. The following code illustrates the
> problem.
> {code:java}
> File archive = new File("CC0 Images.7z");
> char[] password = "password".toCharArray();
> try (SevenZFile f = new SevenZFile(archive, password))
> {
> SevenZArchiveEntry entry =
> StreamSupport.stream(f.getEntries().spliterator(), false)
> .filter(e ->
> "alberta-amazing-attraction-banff-417074.jpg".equals(e.getName()))
> .findFirst().orElseGet(null);
> assert entry != null;
> for (int i = 0; i < 100; i++)
> {
> InputStream is = f.getInputStream(entry);
> BufferedImage img = ImageIO.read(is);
> assert img != null;
> System.out.println("Succeeded " + (i + 1) + " times");
> }
> }{code}
> Below is the output I receive on version 1.20
> {code:java}
> Succeeded 1 times
> Succeeded 2 times
> Exception in thread "main" java.io.IOException: Checksum verification failed
> at
> org.apache.commons.compress.utils.ChecksumVerifyingInputStream.read(ChecksumVerifyingInputStream.java:61)
> at
> org.apache.commons.compress.utils.ChecksumVerifyingInputStream.skip(ChecksumVerifyingInputStream.java:102)
> at org.apache.commons.compress.utils.IOUtils.skip(IOUtils.java:113)
> at
> org.apache.commons.compress.archivers.sevenz.SevenZFile.getCurrentStream(SevenZFile.java:1318)
> at
> org.apache.commons.compress.archivers.sevenz.SevenZFile.getInputStream(SevenZFile.java:1354)
> at org.abitoff.dmav.Test.main(Test.java:11)
> {code}
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)