Subject Re: [Firebird-Java] Blobs and Streams
Author Roman Rokytskyy
> So I am going to use InputStream of the resultset.

There is almost no difference between InputStream and byte[], the main
difference is memory usage - InputStream is a direct stream to blob and no
internal memory allocation happens within the driver (not the case in
auto-commit mode).

> Can someone tell me how fast this is (compared to FileInputStream)?
> I am sure, this is slower, but by what factor?
> I could accept it propably up to 2x, because it is still faster than http
> response transmission.
>
> (BTW, the firebird super server is connected to locally via tcp/ip.)

Most likely the speed is not the issue here, but a scalability. Browsers do
not ask images one by one, but many at once. Since that are separate http
requests, you will need separate connection per request with separate
transactions, otherwise you will have to introduce some very complex
synchronization based on the HttpSession to serve image at once and even
more complex transaction management.

So you have to create tests anyway (my tests show me something ~48 Mbit/s
for reas and ~32 Mbit/s for writes on Pentium M 1,6 MHz laptop, Windows XP,
locally running FB 1.5 SS).

Roman