commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Bodewig (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SANDBOX-286) BZip2CompressorInputStream doesn't work if wrapped into InputStreamReader
Date Thu, 12 Feb 2009 10:41:59 GMT

    [ https://issues.apache.org/jira/browse/SANDBOX-286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672945#action_12672945
] 

Stefan Bodewig commented on SANDBOX-286:
----------------------------------------

But such an implementation would lie, wouldn't it?

The number of bytes you can read after running through decompression is most probably different
from the original count.

Given that the bzip2 format works on blocks it is quite possible that trying to read a single
byte may block on the compressed stream because it needs more than a single byte from the
original stream to complete a block of input.


> BZip2CompressorInputStream doesn't work if wrapped into InputStreamReader
> -------------------------------------------------------------------------
>
>                 Key: SANDBOX-286
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-286
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Compress
>    Affects Versions: Nightly Builds
>         Environment: Unix
>            Reporter: Ingo Rockel
>
> The BZip2CompressorInputStream doesn't work if wrapped into InputStreamReader because
it doesn't implement "public int available()" from InputStream.
> Adding the following method to BZip2CompressorInputStream fixes the problem:
>     public int available() throws IOException {
>         return(in.available());
>     }

-- 
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