Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

Next:From: Mike Cannon-BrookesDate: 2001-05-14 01:36:37
Subject: Compiling JDBC Driver - impossible!
Previous:From: Joe ShevlandDate: 2001-05-14 01:34:19
Subject: RE: Compiling JDBC Driver - impossible!

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group