db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Waagan (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4061) InputStream returned from Blob.getBinaryStream(long, long) terminates the stream by returning 0, should return -1
Date Fri, 20 Feb 2009 10:13:02 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4061?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kristian Waagan updated DERBY-4061:
-----------------------------------

           Derby Info: [Patch Available]
    Affects Version/s: 10.5.0.0
                       10.3.3.0

> 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
>         Attachments: derby-4061-1a.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.


Mime
View raw message