Subject Re[2]: [Firebird-Java]
Author Alexey Panchenko
Roman Rokytskyy wrote:

> There is one issue here - there are applications that use getBytes() for
> small BLOBs, changing this behavior to include one roudtrip will change its
> behavior. Also, personally I would expect that applications fetching big
> BLOBs would use getBinaryStream(), since I want to control the memory
> allocation in my application.

Yes, I can use getInputStream(), and implement the code I sent in the
patch directly in the application, if getBytes() is useless for large

Question about "gdsHelper.getBlobSegment(blob, bufferlength)" and FB
API - if is returns buffer smaller than the requested length does that
mean that there is no more data ? Are Firebird BLOBs still segemented
or they are streamed now ?

If yes, than the way to go is to bypass InputStream and implement
getBytes() directly through these calls. If returned buffer is smaller
than the requested size - it is small BLOB and returned buffer should
be returned to the user directly, else request BLOB length, allocate
the whole BLOB buffer and read it all.

Is this possible ?

And one more question: is it possible for getBlobSegment() to read
data to the specified buffer ? I do not want multiple additional 16k
buffers to be allocated.

Best regards,
Alexey mailto:alex+news@...