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