You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (Resolved) (JIRA)" <ji...@apache.org> on 2012/02/23 02:47:48 UTC
[jira] [Resolved] (COMPRESS-155) CompressorStreamFactory hangs when
creating BZip2CompressorInputStream from ReaderInputStream
[ https://issues.apache.org/jira/browse/COMPRESS-155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb resolved COMPRESS-155.
---------------------------
Resolution: Invalid
Compressed files are a stream of bytes.
It does not make sense to try and decompress a stream of characters.
If there are problems using ReaderInputStream as far as I can tell that is not a bug in Compress.
> CompressorStreamFactory hangs when creating BZip2CompressorInputStream from ReaderInputStream
> ---------------------------------------------------------------------------------------------
>
> Key: COMPRESS-155
> URL: https://issues.apache.org/jira/browse/COMPRESS-155
> Project: Commons Compress
> Issue Type: Bug
> Reporter: PNS
> Priority: Blocker
>
> Assume that one wants to read a BZIP2 file but only has a reference to a BufferedReader object and not to the File object itself.
> An approach would be creating an InputStream from the BufferedReader reference, using the org.apache.commons.io.input.ReaderInputStream class, as follows:
> BufferedReader reader = <the reader to the actual BZIP2 file>;
> InputStream is = new ReaderInputStream(reader);
> CompressorInputStream cis = new CompressorStreamFactory().createCompressorInputStream(is);
> However, the call to the createCompressorInputStream() method hangs on the statement
> int signatureLength = in.read(signature); // CompressorStreamFactory line 93 in commons-compress v1.2
> The problem seems to be in the read(byte[] b, int off, int len) method of ReaderInputStream, which is called by the method fill(), in turn called by read1(byte[] b, int off, int len) in BufferedInputStream.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira