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: (view raw, whole thread or download thread mbox)
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

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-2017 The PostgreSQL Global Development Group