[ 
https://issues.apache.org/jira/browse/COMPRESS-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17044790#comment-17044790
 ] 

Steven Fontaine commented on COMPRESS-505:
------------------------------------------

Oops, sorry, I submitted too soon. Give me a couple minutes to finish typing up 
this problem

> 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
>
> {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}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to