Re: Displaying/Pulling Images using JDBC ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Ho, Khanh" <Khanh(dot)Ho(at)team(dot)telstra(dot)com>, The Hermit Hacker <scrappy(at)hub(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Displaying/Pulling Images using JDBC ...
Date: 2001-05-14 01:36:13
Message-ID: 4679.989804173@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> ! int ret = (buffer[bpos] & 0x7F);
> ! if ((buffer[bpos] &0x80) == 0x80) {
> ! ret |= 0x80;
> ! }

That seems like an awfully ugly (and slow) way of doing unsigned
promotion.

If Java doesn't have a notion of unsigned chars, perhaps this would do:

return ((int) buffer[bpos++]) & 0xFF;

regards, tom lane

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mike Cannon-Brookes 2001-05-14 01:36:37 Compiling JDBC Driver - impossible!
Previous Message Joe Shevland 2001-05-14 01:34:19 RE: Compiling JDBC Driver - impossible!