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

Tim Underwood commented on COMPRESS-231:
----------------------------------------

To support multipart 7z archives I created a read-only SeekableByteChannel 
implementation that wraps multiple SeekableByteChannel instances and just 
concatenates them together.  This appears to be enough to support multipart 7z 
archives (at least for the archives I'm working with).

My code (written in Scala) is here:

[https://github.com/frugalmechanic/fm-common/blob/master/jvm/src/main/scala/fm/common/MultiReadOnlySeekableByteChannel.scala]

An example of opening multipart archives is in here (see the openMultiPart 
method):(

[https://github.com/frugalmechanic/fm-common/blob/master/jvm/src/main/scala/fm/common/SevenZipUtils.scala]

It should be trivial to port it to Java (except for maybe the tailrec 
annotation) and to add it to org.apache.commons.compress.utils alongside 
SeekableInMemoryByteChannel.  If I find some free time I'll take a pass at it.

> Add support for multpart 7z archives
> ------------------------------------
>
>                 Key: COMPRESS-231
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-231
>             Project: Commons Compress
>          Issue Type: Improvement
>          Components: Archivers
>            Reporter: Leon Blakey
>            Priority: Major
>              Labels: 7z
>
> Has support for multipart 7z archives been discussed? Compress would only 
> need to cat the files together.
> In terms of actual implementation I tried to take a stab at it myself but 
> SevenZFile relies on RandomAccessFile which complicates things like 
> readFully() with a buffer that spans 2 files. I stopped when it started 
> getting complex and was wondering what would be the "compress" way to do it



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to