Re: binary data

From: "Uwe Kubosch" <donv(at)crusaders(dot)no>
To: "Anders Hermansen" <anders(at)yoyo(dot)no>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: binary data
Date: 2003-03-02 13:44:26
Message-ID: CHECLDNPGHELOIINBBLEMEEHEIAA.donv@crusaders.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Anders Hermansen 2003-03-02 14:37:30 Re: binary data
Previous Message Anders Hermansen 2003-03-02 13:34:57 Re: binary data