The current implementation of BlobInputStream does not properly handle 8-bit unsigned data as it blindly casts the byte to an int, which java most helpfully promotes to a signed type.  This causes problems when you can only return -1 to indicated EOF.
The current implementation of BlobInputStream does
not properly handle 8-bit unsigned data as it blindly
casts the byte to an int, which java most helpfully
promotes to a signed type.  This causes problems when
you can only return -1 to indicated EOF.

The following patch fixes the bug and has been tested
locally on image data.

Chad David

tivv/pgjdbc,marschall/pgjdbc,golovnin/pgjdbc,Gordiychuk/pgjdbc,underyx/pgjdbc,zapov/pgjdbc,jorsol/pgjdbc,jamesthomp/pgjdbc,phillipross/pgjdbc,pgjdbc/pgjdbc,jamesthomp/pgjdbc,sehrope/pgjdbc,davecramer/pgjdbc,jkutner/pgjdbc,sehrope/pgjdbc,pgjdbc/pgjdbc,jorsol/pgjdbc,panchenko/pgjdbc,davecramer/pgjdbc,thkoch2001/libpostgresql-jdbc-java,lordnelson/pgjdbc,golovnin/pgjdbc,rjmac/pgjdbc,lonnyj/pgjdbc,jorsol/pgjdbc,Gordiychuk/pgjdbc,schlosna/pgjdbc,zemian/pgjdbc,zemian/pgjdbc,amozhenin/pgjdbc,pgjdbc/pgjdbc,underyx/pgjdbc,AlexElin/pgjdbc,lordnelson/pgjdbc,Gordiychuk/pgjdbc,marschall/pgjdbc,golovnin/pgjdbc,marschall/pgjdbc,amozhenin/pgjdbc,thkoch2001/libpostgresql-jdbc-java,bocap/pgjdbc,jkutner/pgjdbc,phillipross/pgjdbc,jkutner/pgjdbc,sehrope/pgjdbc,jamesthomp/pgjdbc,lonnyj/pgjdbc,rjmac/pgjdbc,ekoontz/pgjdbc,tivv/pgjdbc,AlexElin/pgjdbc,whitingjr/pgjdbc,bocap/pgjdbc,AlexElin/pgjdbc,alexismeneses/pgjdbc,sehrope/pgjdbc,bocap/pgjdbc,phillipross/pgjdbc,marschall/pgjdbc,amozhenin/pgjdbc,schlosna/pgjdbc,whitingjr/pgjdbc,jorsol/pgjdbc,underyx/pgjdbc,thkoch2001/libpostgresql-jdbc-java,panchenko/pgjdbc,whitingjr/pgjdbc,alexismeneses/pgjdbc,ekoontz/pgjdbc,zapov/pgjdbc,pgjdbc/pgjdbc,lordnelson/pgjdbc,davecramer/pgjdbc,rjmac/pgjdbc,zapov/pgjdbc,zemian/pgjdbc,davecramer/pgjdbc,panchenko/pgjdbc