Results 1 to 3 of 3
  1. #1
    Boomn4x4 is offline Member
    Join Date
    Nov 2011
    Posts
    18
    Rep Power
    0

    Default Extracting cpio that is bzip2 compressed.

    I'm trying to extract a bzip2 file that has a cpio archive in it, created using

    find . | cpio -ocv | bzip2 > MYFILE.

    Using the apache common compress libraries, I'm unable to extract it.

    using a Files.probeContentType(file) method, I'm seeing that its in "application/x-bzip" which I believe is correct. However, when sending it through to the BZIP2CompressorInputStream I'm getting an IOException: Error detected parsing the header.

    The problem seems to be in how the file is created and not the application as any single file compressed simply using bzip works fine. Its just seems to be a problem that the bzip2 file is a cpio archive.

    Any ideas how to address this?
    Last edited by Boomn4x4; 04-08-2015 at 02:44 PM.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Extracting cpio that is bzip2 compressed.

    Does the file decompress properly using the CLI bzip2 program that compressed it? Have you tried other to decompress other files? Perhaps your question(s) should be directed to the Apache user group for bzip2 and/or the actual bzip website.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    Boomn4x4 is offline Member
    Join Date
    Nov 2011
    Posts
    18
    Rep Power
    0

    Default Re: Extracting cpio that is bzip2 compressed.

    Yes, it decompresses fine using the programs. The issue itself seems to be with the apache commons library. I'll redirect this question to them.

Similar Threads

  1. Needs to be compressed in to simpler code.
    By thomachan21 in forum New To Java
    Replies: 2
    Last Post: 12-05-2012, 10:11 AM
  2. Transfer Compressed Array from RS232 port to USB
    By RacingSalmander in forum New To Java
    Replies: 1
    Last Post: 07-29-2012, 09:08 AM
  3. Compressed Image in j2me
    By Ashish_jain in forum New To Java
    Replies: 7
    Last Post: 07-04-2011, 02:50 PM
  4. Create GZIP compressed data using DeflaterInputStream?
    By johann_p in forum Advanced Java
    Replies: 15
    Last Post: 05-17-2011, 11:56 AM
  5. Self-extracting JAR
    By kennyman94 in forum Advanced Java
    Replies: 4
    Last Post: 05-10-2011, 03:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •