From: Uwe Kubosch <donv@crusaders.no>
To: Anders Hermansen <anders@yoyo.no>
To: pgsql-jdbc@postgresql.org
Subject: Re: binary data
Date: Sun, 2 Mar 2003 14:44:26 +0100
Message-ID: <CHECLDNPGHELOIINBBLEMEEHEIAA.donv@crusaders.no> (raw)
In-Reply-To: <20030302133457.GA18675@online.no>
Hi!
> Show us the code that saves the InputStream to a file.
This is a web-application that streams the InpuStream back to the browser.
The code that does this is like this:
byte[] buffer;
int bytesRead;
buffer = new byte[is.available()];
while (is.available() > 0) {
bytesRead = is.read(buffer);
response.getOutputStream().write(buffer, 0, bytesRead);
}
response.getOutputStream().flush();
is.close();
Uwe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: donv@crusaders.no, anders@yoyo.no
Subject: Re: binary data
In-Reply-To: <CHECLDNPGHELOIINBBLEMEEHEIAA.donv@crusaders.no>
References: <20030302133457.GA18675@online.no> <CHECLDNPGHELOIINBBLEMEEHEIAA.donv@crusaders.no>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox