Re: Displaying/Pulling Images using JDBC ... - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: Displaying/Pulling Images using JDBC ...
Date
Msg-id 4679.989804173@sss.pgh.pa.us
Whole thread Raw
In response to Re: Displaying/Pulling Images using JDBC ...  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-jdbc
Bruce Momjian <pgman@candle.pha.pa.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

pgsql-jdbc by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Compiling JDBC Driver - impossible!
Next
From: Joe Shevland
Date:
Subject: RE: Compiling JDBC Driver - impossible!