Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 49374 invoked from network); 24 Feb 2009 14:36:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Feb 2009 14:36:28 -0000 Received: (qmail 51353 invoked by uid 500); 24 Feb 2009 14:36:27 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 51325 invoked by uid 500); 24 Feb 2009 14:36:27 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 51316 invoked by uid 99); 24 Feb 2009 14:36:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Feb 2009 06:36:27 -0800 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Feb 2009 14:36:25 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CDF5F234C498 for ; Tue, 24 Feb 2009 06:36:04 -0800 (PST) Message-ID: <1999890095.1235486164842.JavaMail.jira@brutus> Date: Tue, 24 Feb 2009 06:36:04 -0800 (PST) From: "Kristian Waagan (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Resolved: (DERBY-4061) InputStream returned from Blob.getBinaryStream(long, long) terminates the stream by returning 0, should return -1 In-Reply-To: <1409363555.1234822079534.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4061?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kristian Waagan resolved DERBY-4061. ------------------------------------ Resolution: Fixed Fix Version/s: 10.4.2.1 10.3.3.1 Backported fix to 10.4 with revision 747393 and to 10.3 with revision 747395. > InputStream returned from Blob.getBinaryStream(long, long) terminates the stream by returning 0, should return -1 > ----------------------------------------------------------------------------------------------------------------- > > Key: DERBY-4061 > URL: https://issues.apache.org/jira/browse/DERBY-4061 > Project: Derby > Issue Type: Bug > Components: JDBC > Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.0.0 > Reporter: Trejkaz > Assignee: Kristian Waagan > Fix For: 10.3.3.1, 10.4.2.1, 10.5.0.0 > > Attachments: derby-4061-1a.diff, derby-4061-1b.diff > > > Take the following code to copy a sub-stream from a BLOB: > Blob blob = rs.getBlob(1); > InputStream stream = blob.getBinaryStream(1000, 2000); > try { > IOUtils.copy(stream, out); > } finally { > stream.close(); > } > This will loop forever in IOUtils.copy, as the InputStream is returning 0 at end of stream instead of -1. It probably should return -1 to comply with the Javadoc for InputStream. > Notes: > I have not yet checked Blob.getBinaryStream(), or any of the Clob methods, or the client driver. So some of these may have a similar issue. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.