commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "PNS (JIRA)" <j...@apache.org>
Subject [jira] [Created] (COMPRESS-155) CompressorStreamFactory hangs when creating BZip2CompressorInputStream from ReaderInputStream
Date Sat, 20 Aug 2011 21:42:27 GMT
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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message