You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2019/10/28 08:13:22 UTC

[GitHub] [commons-compress] PeterAlfreadLee edited a comment on issue #84: COMPRESS-477 Add support for extracting splitted zip files

PeterAlfreadLee edited a comment on issue #84: COMPRESS-477 Add support for extracting splitted zip files
URL: https://github.com/apache/commons-compress/pull/84#issuecomment-546836930
 
 
   I just pushed the code of adding support for splitted zip in `ZipArchiveInputStream`.
   I didn't change much. Just skip the markers here
   [ if (sig.equals(ZipLong.DD_SIG)) {](https://github.com/apache/commons-compress/blob/205876d6f9eb60ac31f3ec848b23d025f32995ab/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java#L370)
   
   Sample code:
   ```
   File lastFile = getFile("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip_zip64.zip");
   // build the input stream by just concatenating the splitted zips together
   SeekableByteChannel channel = ZipSplitReadOnlySeekableByteChannel.buildFromLastSplitSegment(lastFile);
   InputStream inputStream = Channels.newInputStream(channel);
   ZipArchiveInputStream splitInputStream = new ZipArchiveInputStream(inputStream);
   
   ArchiveEntry entry;
   while((entry = splitInputStream.getNextEntry()) != null) {
       // read from ZipArchiveInputStream
       ...
   }
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services