Subject Re: [Firebird-Java] Blob reading example from the release notes??
Author Rick Fincher
Hi Frederic,

I think you are right.

The code:
if ( (bytesread = bis.read(bindata,0,bindata.length)) != -1 ) {

// Write out 'bytesread' bytes to the writer instance:

baos.write(bindata,0,bytesread);

} else {

// When the read() method returns -1 we've hit the end of the stream,

// so now we can get our bytes out of the writer object:

returndata = baos.getBytes();

Should be:

while ( (bytesread = bis.read(bindata,0,bindata.length)) != -1 ) {

// Write out 'bytesread' bytes to the writer instance:

baos.write(bindata,0,bytesread);

}

// When the read() method returns -1 we've hit the end of the stream,

// so now we can get our bytes out of the writer object:

returndata = baos.getBytes();

I'll test that out to be sure, and update the release notes.



Thanks,

Rick



----- Original Message -----
From: "fredlaub" <fredlaub@...>
To: <Firebird-Java@yahoogroups.com>
Sent: Saturday, October 05, 2002 7:18 AM
Subject: [Firebird-Java] Blob reading example from the release notes??


> Hi,
>
> The example of Blob reading uses a buffered stream of 1024 bytes and
> no loop.
> Isn't a loop necessary in case there are more than 1024 bytes in the
> blob column?
> Am I missing something?
> Sorry if it's a trivial question, the whole thing is quite new to me.
>
> Regards
> Frederic
>
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>