commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Grobmeier (JIRA)" <j...@apache.org>
Subject [jira] Updated: (COMPRESS-28) CPIO reports unexpected EOF
Date Thu, 26 Mar 2009 05:13:50 GMT

     [ https://issues.apache.org/jira/browse/COMPRESS-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Christian Grobmeier updated COMPRESS-28:
----------------------------------------

    Attachment: patch_cpiotestcases_closing.txt

This patch includes:
- Improvment of Testcases
- Small changes on CpioOutstream: to work correctly with this Streams, you had to call a finish()
method besides the usually closeEntry. Now its working as all the other Stream classes in
compress

When applied, this issue should be resolved

> CPIO reports unexpected EOF
> ---------------------------
>
>                 Key: COMPRESS-28
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-28
>             Project: Commons Compress
>          Issue Type: Bug
>            Reporter: Christian Grobmeier
>             Fix For: 1.0
>
>         Attachments: patch-improvedcpiodocs.txt, patch_cpiotestcases_closing.txt
>
>
> When unpacking an CPIO archive (made with the compress classes or even made with OSX
cpio comandline tool) an EOF exception is thrown.
> Here is the testcode:
>         final File input = getFile("cmdcreated.cpio");
>         final InputStream in = new FileInputStream(input);
>         CpioArchiveInputStream cin = new CpioArchiveInputStream(in);
>         CpioArchiveEntry entry = null;
>         while ((entry = (CpioArchiveEntry) cin.getNextCPIOEntry()) != null) {
>             File target = new File(dir, entry.getName());
>             final OutputStream out = new FileOutputStream(target);
>             IOUtils.copy(in, out);
>             out.close();
>         }
>         cin.close();
> Stacktrace is here:
> java.io.EOFException
> 	at org.apache.commons.compress.archivers.cpio.CpioArchiveInputStream.readFully(CpioArchiveInputStream.java:293)
> 	at org.apache.commons.compress.archivers.cpio.CpioArchiveInputStream.getNextCPIOEntry(CpioArchiveInputStream.java:168)
> 	at org.apache.commons.compress.archivers.cpio.CpioArchiveInputStreamTest.testCpioUnpack(CpioArchiveInputStreamTest.java:26)
> 	...
> This happens with the first read access to the archive. It occured while my try to improve
the testcases.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message