Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 24626 invoked from network); 20 Jan 2011 10:11:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Jan 2011 10:11:09 -0000 Received: (qmail 38252 invoked by uid 500); 20 Jan 2011 10:11:08 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 37957 invoked by uid 500); 20 Jan 2011 10:11:06 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 37949 invoked by uid 99); 20 Jan 2011 10:11:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jan 2011 10:11:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jan 2011 10:11:05 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p0KAAib0017569 for ; Thu, 20 Jan 2011 10:10:44 GMT Message-ID: <8143560.78821295518244432.JavaMail.jira@thor> Date: Thu, 20 Jan 2011 05:10:44 -0500 (EST) From: "Robert Lichtenberger (JIRA)" To: issues@commons.apache.org Subject: [jira] Created: (COMPRESS-125) BZip2CompressorInputStream throws IOException if underlying stream returns available() == 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 BZip2CompressorInputStream throws IOException if underlying stream returns available() == 0 ------------------------------------------------------------------------------------------- Key: COMPRESS-125 URL: https://issues.apache.org/jira/browse/COMPRESS-125 Project: Commons Compress Issue Type: Bug Components: Compressors Affects Versions: 1.1 Reporter: Robert Lichtenberger Priority: Minor BzipCompressorInput,init() will throw an IOException, if the passed stream returns 0 for available(): {code:title=BzipCompressorInput,.java|borderStyle=solid} private void init() throws IOException { ... if (in.available() == 0) { throw new IOException("Empty InputStream"); } ... } {code} I think this is not correct, because the underlying stream may indeed be able to only return 0 bytes without blocking but may be able to block a little and then return some more bytes. Note also the change in the API documentation from: "Returns the number of bytes that can be read " (1.4.2) to "Returns an estimate of the number of bytes that can be read". -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.