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

Dawid Weiss commented on COMPRESS-320:
--------------------------------------

True random access would be possible, but at some costs. First of all, I did 
not want to change the API, hoping this would facilitate integration in the 
next(ish) release (yes, this was selfish). Second, I did not want to change the 
API because, quite honestly, it would take either a thorough shakeup to make it 
sensible or not much at all to keep it similar to what it was before. The API 
is shaped after ZipFile/ZipInputStream from the JDK, which probably isn't 
"modern" but is straightforward enough, I understand it.

There is also a major third reason. If you have "solid" archives in 7z a block 
can hold multiple files and random access to (N+1)-th file within a block 
requires uncompressing previous N files. So it is a choice between linear 
access and potentially fast full-block skipping or random access and having to 
design some complex bookkeeping to make sure you don't recompress the block's 
files over and over again -- accessing a block's files from (N...1) would be a 
performance disaster...

> File listing and random access of 7Z files
> ------------------------------------------
>
>                 Key: COMPRESS-320
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-320
>             Project: Commons Compress
>          Issue Type: Improvement
>          Components: Archivers
>            Reporter: Bill Chen
>            Priority: Minor
>
> I guess these must be one of the most wanted features and it should be very 
> simple to implement (as I have done one in 126 lines).
> Most (if not all) of the infrastructure is already there, including an index 
> of all files. And, with some careful coding, the capability to read any of 
> them in any order concurrently was not difficult to add.
> My code uses loads of lambda and reflection stuff, but I am happy to 
> contribute a clean Java 5/6 implementation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to