Re: binary data

From: Anders Hermansen <anders(at)yoyo(dot)no>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: binary data
Date: 2003-03-02 15:17:26
Message-ID: 20030302151726.GA20097@online.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

* Uwe Kubosch (donv(at)crusaders(dot)no) wrote:
> This is a web-application that streams the InpuStream back to the browser.
> The code that does this is like this:

Can you try the following? Maybe the result slipped through the driver
without being decoded?

// I think this will work because the is is a ByteArrayInputStream
byte[] buffer = new byte[is.available()];
is.read(buffer);

byte[] buffer2 = org.postgresql.util.PGbytea.toBytes(buffer);

response.getOutputStream().write(buffer2, 0, buffer2.length);
response.getOutputStream().flush();
is.close();

Anders

--
Anders Hermansen
YoYo Mobile as

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Uwe Kubosch 2003-03-02 15:34:59 Re: binary data
Previous Message Uwe Kubosch 2003-03-02 15:05:47 Re: binary data