Re: BLOB help - yes I've read around!

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: BLOB help - yes I've read around!
Дата
Msg-id grhgpj$vqr$1@ger.gmane.org
обсуждение исходный текст
Ответ на Re: BLOB help - yes I've read around!  (Brad Milne <mail_4brad@yahoo.co.uk>)
Список pgsql-jdbc
Brad Milne, 07.04.2009 23:55:
>> 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.

I have never used AudioInputStream. If that one reports the real size when calling available() then it would be the
firstInputStream that I have seen that does that ;) 

If you do use available() you should verify that the size of your BLOB (bytea) in the database is really what you
expected.You have to test with sizes that exceed any potential buffer that takes place in the input stream, and I would
inspectthe source code for available().  

Thomas

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Array passing
Следующее
От: John Lister
Дата:
Сообщение: Re: Array passing