Re: BLOB help - yes I've read around! - Mailing list pgsql-jdbc

From Brad Milne
Subject Re: BLOB help - yes I've read around!
Date
Msg-id 49DBCBC2.6080402@yahoo.co.uk
Whole thread Raw
In response to Re: BLOB help - yes I've read around!  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: BLOB help - yes I've read around!  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-jdbc
Thomas Kellerer wrote:
> Brad Milne wrote on 07.04.2009 23:34:
>> For completeness, here is the setter again with a couple of fixes:
>>
>> stmt.setBinaryStream(2,in,in.available());
>
> Do not use availabe()
>
> This will *not* give you the number of bytes that are "available" in
> the stream.
>
> Read the Javadocs carefully: it will give you the number of bytes that
> can be /read without blocking/
>
> Most of the time this will not be the length of the stream.
>
Good point Thomas, I hear you. I shouldn't have written that hear as
others could follow that. In my implementation it is ok as the stream is
complete prior to persisting it. I have an AudioInputStream object, but
it is always complete. If you think I should be therefore using a
different method/db object then I'd be pleased to hear.

Thanks
Brad

pgsql-jdbc by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: BLOB help - yes I've read around!
Next
From: Kris Jurka
Date:
Subject: Re: Array passing