[jira] [Updated] (COMPRESS-452) "Stream is not in the BZip2 format" exception on valid archive
[ https://issues.apache.org/jira/browse/COMPRESS-452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tomisław Kityński updated COMPRESS-452: --- Description: The included 7z archive (with only one file), that is password protected, can be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is not in the BZip2 format" exception. The code is: {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes();}} {{public static void main(String[] args) throws IOException {}} {{ String fileName = "r:/txt.7z";}} {{ SevenZArchiveEntry entry;}} {{ try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) {}} {{ while ((entry = arch.getNextEntry()) != null) }}{ {{ System.out.println(entry.getName());}} } } {{}}} The same exception is thrown when one uses SevenZFile(SeekableByteBuffer, byte[]) constructor. Password seems to be OK, since changing it yields different exception (and it also works in 7z tool). Full exception is: {{Exception in thread "main" java.io.IOException: Stream is not in the BZip2 format}} at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.init(BZip2CompressorInputStream.java:252) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:134) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:112) at org.apache.commons.compress.archivers.sevenz.Coders$BZIP2Decoder.decode(Coders.java:254) at org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(Coders.java:79) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(SevenZFile.java:933) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:909) at org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(SevenZFile.java:222) at UnpackTest.main(UnpackTest.java:17) was: The included 7z archive (with only one file), that is password protected, can be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is not in the BZip2 format" exception. The code is: {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes();}} {{public static void main(String[] args) throws IOException {}} {{ String fileName = "r:/txt.7z";}} {{ SevenZArchiveEntry entry;}} {{ try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) {}} {{ while ((entry = arch.getNextEntry()) != null) }}{{{}} {{ System.out.println(entry.getName());}} {{ }}} {{ }}} {{}}} The same exception is thrown when one uses SevenZFile(SeekableByteBuffer, byte[]) constructor. Password seems to be OK, since changing it yields different exception (and it also works in 7z tool). Full exception is: {{Exception in thread "main" java.io.IOException: Stream is not in the BZip2 format}} {{ at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.init(BZip2CompressorInputStream.java:252)}} {{ at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:134)}} {{ at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:112)}} {{ at org.apache.commons.compress.archivers.sevenz.Coders$BZIP2Decoder.decode(Coders.java:254)}} {{ at org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(Coders.java:79)}} {{ at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(SevenZFile.java:933)}} {{ at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:909)}} {{ at org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(SevenZFile.java:222)}} {{ at UnpackTest.main(UnpackTest.java:17)}} > "Stream is not in the BZip2 format" exception on valid archive > -- > > Key: COMPRESS-452 > URL: https://issues.apache.org/jira/browse/COMPRESS-452 > Project: Commons Compress > Issue Type: Bug > Components: Archivers, Compressors >Affects Versions: 1.16.1 >Reporter: Tomisław Kityński >Priority: Major > Fix For: 1.16.1 > > Attachments: txt.7z > > > The included 7z archive (with only one file), that is password protected, can > be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is > not in the BZip2 format" exception. > The code is: > {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes();}} > {{public static void main(String[] args) throws IOException {}} > {{ String fileName = "r:/txt.7z";}} > {{ SevenZArchiveEntry entry;}} > {{ try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) > {}} > {{ while
[jira] [Updated] (COMPRESS-452) "Stream is not in the BZip2 format" exception on valid archive
[ https://issues.apache.org/jira/browse/COMPRESS-452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tomisław Kityński updated COMPRESS-452: --- Description: The included 7z archive (with only one file), that is password protected, can be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is not in the BZip2 format" exception. The code is: {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes();}} {{}} {{public static void main(String[] args) throws IOException {}} {{ String fileName = "r:/txt.7z";}} {{ SevenZArchiveEntry entry;}} {{ try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) {}} {{ while ((entry = arch.getNextEntry()) != null) {}} {{ System.out.println(entry.getName());}} {{ }}} {{ }}} {{}}} The same exception is thrown when one uses SevenZFile(SeekableByteBuffer, byte[]) constructor. Password seems to be OK, since changing it yields different exception (and it also works in 7z tool). Full exception is: {{Exception in thread "main" java.io.IOException: Stream is not in the BZip2 format at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.init(BZip2CompressorInputStream.java:252) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:134) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:112) at org.apache.commons.compress.archivers.sevenz.Coders$BZIP2Decoder.decode(Coders.java:254) at org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(Coders.java:79) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(SevenZFile.java:933) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:909) at org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(SevenZFile.java:222) at UnpackTest.main(UnpackTest.java:17)}} was: The included 7z archive (with only one file), that is password protected, can be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is not in the BZip2 format" exception. The code is: {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes();}} {{public static void main(String[] args) throws IOException {}} {{ String fileName = "r:/txt.7z";}} {{ SevenZArchiveEntry entry;}} {{ try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) {}} {{ while ((entry = arch.getNextEntry()) != null) }}{ {{ System.out.println(entry.getName());}} } } {{}}} The same exception is thrown when one uses SevenZFile(SeekableByteBuffer, byte[]) constructor. Password seems to be OK, since changing it yields different exception (and it also works in 7z tool). Full exception is: {{Exception in thread "main" java.io.IOException: Stream is not in the BZip2 format}} at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.init(BZip2CompressorInputStream.java:252) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:134) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:112) at org.apache.commons.compress.archivers.sevenz.Coders$BZIP2Decoder.decode(Coders.java:254) at org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(Coders.java:79) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(SevenZFile.java:933) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:909) at org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(SevenZFile.java:222) at UnpackTest.main(UnpackTest.java:17) > "Stream is not in the BZip2 format" exception on valid archive > -- > > Key: COMPRESS-452 > URL: https://issues.apache.org/jira/browse/COMPRESS-452 > Project: Commons Compress > Issue Type: Bug > Components: Archivers, Compressors >Affects Versions: 1.16.1 >Reporter: Tomisław Kityński >Priority: Major > Fix For: 1.16.1 > > Attachments: txt.7z > > > The included 7z archive (with only one file), that is password protected, can > be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is > not in the BZip2 format" exception. > The code is: > {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes();}} > {{}} > {{public static void main(String[] args) throws IOException {}} > {{ String fileName = "r:/txt.7z";}} > {{ SevenZArchiveEntry entry;}} > {{ try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) > {}} > {{ while ((entry = arc
[jira] [Updated] (COMPRESS-452) "Stream is not in the BZip2 format" exception on valid archive
[ https://issues.apache.org/jira/browse/COMPRESS-452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tomisław Kityński updated COMPRESS-452: --- Description: The included 7z archive (with only one file), that is password protected, can be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is not in the BZip2 format" exception. The code is: {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes(); public static void main(String[] args) throws IOException { String fileName = "r:/txt.7z"; SevenZArchiveEntry entry; try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) { while ((entry = arch.getNextEntry()) != null) { System.out.println(entry.getName()); } } }}} The same exception is thrown when one uses SevenZFile(SeekableByteBuffer, byte[]) constructor. Password seems to be OK, since changing it yields different exception (and it also works in 7z tool). Full exception is: Exception in thread "main" java.io.IOException: Stream is not in the BZip2 format at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.init(BZip2CompressorInputStream.java:252) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:134) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:112) at org.apache.commons.compress.archivers.sevenz.Coders$BZIP2Decoder.decode(Coders.java:254) at org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(Coders.java:79) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(SevenZFile.java:933) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:909) at org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(SevenZFile.java:222) at UnpackTest.main(UnpackTest.java:17) PS Sorry for the bad formatting, but I it seems like this editor must be much smarter than me and it knows better. was: The included 7z archive (with only one file), that is password protected, can be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is not in the BZip2 format" exception. The code is: {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes();}} {{}} {{public static void main(String[] args) throws IOException {}} {{ String fileName = "r:/txt.7z";}} {{ SevenZArchiveEntry entry;}} {{ try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) {}} {{ while ((entry = arch.getNextEntry()) != null) {}} {{ System.out.println(entry.getName());}} {{ }}} {{ }}} {{}}} The same exception is thrown when one uses SevenZFile(SeekableByteBuffer, byte[]) constructor. Password seems to be OK, since changing it yields different exception (and it also works in 7z tool). Full exception is: {{Exception in thread "main" java.io.IOException: Stream is not in the BZip2 format at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.init(BZip2CompressorInputStream.java:252) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:134) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:112) at org.apache.commons.compress.archivers.sevenz.Coders$BZIP2Decoder.decode(Coders.java:254) at org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(Coders.java:79) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(SevenZFile.java:933) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:909) at org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(SevenZFile.java:222) at UnpackTest.main(UnpackTest.java:17)}} > "Stream is not in the BZip2 format" exception on valid archive > -- > > Key: COMPRESS-452 > URL: https://issues.apache.org/jira/browse/COMPRESS-452 > Project: Commons Compress > Issue Type: Bug > Components: Archivers, Compressors >Affects Versions: 1.16.1 >Reporter: Tomisław Kityński >Priority: Major > Fix For: 1.16.1 > > Attachments: txt.7z > > > The included 7z archive (with only one file), that is password protected, can > be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is > not in the BZip2 format" exception. > The code is: > {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes(); > public static void main(String[] args) throws IOException { > String fileName = "r:/txt.7z"; > SevenZArchiveEntry entry; > try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) { > wh
[jira] [Updated] (COMPRESS-452) "Stream is not in the BZip2 format" exception on valid archive
[ https://issues.apache.org/jira/browse/COMPRESS-452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tomisław Kityński updated COMPRESS-452: --- Description: The included 7z archive (with only one file), that is password protected, can be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is not in the BZip2 format" exception. The code is: {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes(); public static void main(String[] args) throws IOException { String fileName = "r:/txt.7z"; SevenZArchiveEntry entry; try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) { while ((entry = arch.getNextEntry()) != null) { System.out.println(entry.getName()); } } }}} The same exception is thrown when one uses SevenZFile(SeekableByteChannel, byte[]) constructor. Password seems to be OK, since changing it yields different exception (and it also works in 7z tool). Full exception is: Exception in thread "main" java.io.IOException: Stream is not in the BZip2 format at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.init(BZip2CompressorInputStream.java:252) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:134) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:112) at org.apache.commons.compress.archivers.sevenz.Coders$BZIP2Decoder.decode(Coders.java:254) at org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(Coders.java:79) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(SevenZFile.java:933) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:909) at org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(SevenZFile.java:222) at UnpackTest.main(UnpackTest.java:17) PS Sorry for the bad formatting, but I it seems like this editor must be much smarter than me and it knows better. was: The included 7z archive (with only one file), that is password protected, can be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is not in the BZip2 format" exception. The code is: {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes(); public static void main(String[] args) throws IOException { String fileName = "r:/txt.7z"; SevenZArchiveEntry entry; try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) { while ((entry = arch.getNextEntry()) != null) { System.out.println(entry.getName()); } } }}} The same exception is thrown when one uses SevenZFile(SeekableByteBuffer, byte[]) constructor. Password seems to be OK, since changing it yields different exception (and it also works in 7z tool). Full exception is: Exception in thread "main" java.io.IOException: Stream is not in the BZip2 format at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.init(BZip2CompressorInputStream.java:252) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:134) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:112) at org.apache.commons.compress.archivers.sevenz.Coders$BZIP2Decoder.decode(Coders.java:254) at org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(Coders.java:79) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(SevenZFile.java:933) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:909) at org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(SevenZFile.java:222) at UnpackTest.main(UnpackTest.java:17) PS Sorry for the bad formatting, but I it seems like this editor must be much smarter than me and it knows better. > "Stream is not in the BZip2 format" exception on valid archive > -- > > Key: COMPRESS-452 > URL: https://issues.apache.org/jira/browse/COMPRESS-452 > Project: Commons Compress > Issue Type: Bug > Components: Archivers, Compressors >Affects Versions: 1.16.1 >Reporter: Tomisław Kityński >Priority: Major > Fix For: 1.16.1 > > Attachments: txt.7z > > > The included 7z archive (with only one file), that is password protected, can > be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is > not in the BZip2 format" exception. > The code is: > {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes(); > public static void main(String[] args) throws IOException { > String fileName = "r:/txt.7z"; > SevenZArchiveEntry entry; > try (SevenZFile arch = new
[jira] [Updated] (COMPRESS-452) "Stream is not in the BZip2 format" exception on valid archive
[ https://issues.apache.org/jira/browse/COMPRESS-452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Bodewig updated COMPRESS-452: Fix Version/s: (was: 1.16.1) > "Stream is not in the BZip2 format" exception on valid archive > -- > > Key: COMPRESS-452 > URL: https://issues.apache.org/jira/browse/COMPRESS-452 > Project: Commons Compress > Issue Type: Bug > Components: Archivers, Compressors >Affects Versions: 1.16.1 >Reporter: Tomisław Kityński >Priority: Major > Attachments: txt.7z > > > The included 7z archive (with only one file), that is password protected, can > be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is > not in the BZip2 format" exception. > The code is: > {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes(); > public static void main(String[] args) throws IOException { > String fileName = "r:/txt.7z"; > SevenZArchiveEntry entry; > try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) { > while ((entry = arch.getNextEntry()) != null) > { System.out.println(entry.getName()); } > } > }}} > The same exception is thrown when one uses SevenZFile(SeekableByteChannel, > byte[]) constructor. Password seems to be OK, since changing it yields > different exception (and it also works in 7z tool). > Full exception is: > Exception in thread "main" java.io.IOException: Stream is not in the BZip2 > format > at > org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.init(BZip2CompressorInputStream.java:252) > at > org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:134) > at > org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:112) > at > org.apache.commons.compress.archivers.sevenz.Coders$BZIP2Decoder.decode(Coders.java:254) > at > org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(Coders.java:79) > at > org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(SevenZFile.java:933) > at > org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:909) > at > org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(SevenZFile.java:222) > at UnpackTest.main(UnpackTest.java:17) > PS Sorry for the bad formatting, but I it seems like this editor must be > much smarter than me and it knows better. > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (COMPRESS-452) "Stream is not in the BZip2 format" exception on valid archive
[ https://issues.apache.org/jira/browse/COMPRESS-452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Osipov updated COMPRESS-452: Description: The included 7z archive (with only one file), that is password protected, can be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is not in the BZip2 format" exception. The code is: {code:java} private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes(); public static void main(String[] args) throws IOException { String fileName = "r:/txt.7z"; SevenZArchiveEntry entry; try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) { while ((entry = arch.getNextEntry()) != null) { System.out.println(entry.getName()); } } {code} The same exception is thrown when one uses SevenZFile(SeekableByteChannel, byte[]) constructor. Password seems to be OK, since changing it yields different exception (and it also works in 7z tool). Full exception is: {noformat} Exception in thread "main" java.io.IOException: Stream is not in the BZip2 format at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.init(BZip2CompressorInputStream.java:252) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:134) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:112) at org.apache.commons.compress.archivers.sevenz.Coders$BZIP2Decoder.decode(Coders.java:254) at org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(Coders.java:79) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(SevenZFile.java:933) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:909) at org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(SevenZFile.java:222) at UnpackTest.main(UnpackTest.java:17) {noformat} was: The included 7z archive (with only one file), that is password protected, can be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is not in the BZip2 format" exception. The code is: {{private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes(); public static void main(String[] args) throws IOException { String fileName = "r:/txt.7z"; SevenZArchiveEntry entry; try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) { while ((entry = arch.getNextEntry()) != null) { System.out.println(entry.getName()); } } }}} The same exception is thrown when one uses SevenZFile(SeekableByteChannel, byte[]) constructor. Password seems to be OK, since changing it yields different exception (and it also works in 7z tool). Full exception is: Exception in thread "main" java.io.IOException: Stream is not in the BZip2 format at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.init(BZip2CompressorInputStream.java:252) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:134) at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:112) at org.apache.commons.compress.archivers.sevenz.Coders$BZIP2Decoder.decode(Coders.java:254) at org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(Coders.java:79) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(SevenZFile.java:933) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:909) at org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(SevenZFile.java:222) at UnpackTest.main(UnpackTest.java:17) PS Sorry for the bad formatting, but I it seems like this editor must be much smarter than me and it knows better. > "Stream is not in the BZip2 format" exception on valid archive > -- > > Key: COMPRESS-452 > URL: https://issues.apache.org/jira/browse/COMPRESS-452 > Project: Commons Compress > Issue Type: Bug > Components: Archivers, Compressors >Affects Versions: 1.16.1 >Reporter: Tomisław Kityński >Priority: Major > Attachments: txt.7z > > > The included 7z archive (with only one file), that is password protected, can > be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is > not in the BZip2 format" exception. > The code is: > {code:java} > private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes(); > public static void main(String[] args) throws IOException { > String fileName = "r:/txt.7z"; > SevenZArchiveEntry entry; > try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) { > while ((entry = arch.getNextEntry()) != null) > { S
[jira] [Updated] (COMPRESS-452) "Stream is not in the BZip2 format" exception on valid archive
[ https://issues.apache.org/jira/browse/COMPRESS-452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Osipov updated COMPRESS-452: Assignee: Stefan Bodewig > "Stream is not in the BZip2 format" exception on valid archive > -- > > Key: COMPRESS-452 > URL: https://issues.apache.org/jira/browse/COMPRESS-452 > Project: Commons Compress > Issue Type: Bug > Components: Archivers, Compressors >Affects Versions: 1.16.1 >Reporter: Tomisław Kityński >Assignee: Stefan Bodewig >Priority: Major > Fix For: 1.17 > > Attachments: txt.7z > > > The included 7z archive (with only one file), that is password protected, can > be properly decompressed with 7z tool. Yet, getNextEntry() throws "Stream is > not in the BZip2 format" exception. > The code is: > {code:java} > private static final byte[] PASSWORD = "iBlm8NTigvru0Jr0".getBytes(); > public static void main(String[] args) throws IOException { > String fileName = "r:/txt.7z"; > SevenZArchiveEntry entry; > try (SevenZFile arch = new SevenZFile(new File(fileName), PASSWORD)) { > while ((entry = arch.getNextEntry()) != null) > { System.out.println(entry.getName()); } > } > {code} > The same exception is thrown when one uses SevenZFile(SeekableByteChannel, > byte[]) constructor. Password seems to be OK, since changing it yields > different exception (and it also works in 7z tool). > Full exception is: > {noformat} > Exception in thread "main" java.io.IOException: Stream is not in the BZip2 > format > at > org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.init(BZip2CompressorInputStream.java:252) > at > org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:134) > at > org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.(BZip2CompressorInputStream.java:112) > at > org.apache.commons.compress.archivers.sevenz.Coders$BZIP2Decoder.decode(Coders.java:254) > at > org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(Coders.java:79) > at > org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(SevenZFile.java:933) > at > org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:909) > at > org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(SevenZFile.java:222) > at UnpackTest.main(UnpackTest.java:17) > {noformat} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)