Hello,
org.postgresql.jdbc1.AbstractJdbc1Statement.setBinaryStream()
in postgresql 7.4.1 wrongly assumes, that
java.io.InputStream.read(byte[] b,int offset,int len )
will always read len bytes. InputStream only guarantees to
return at least 1 byte per call. The attached patch solves the bug.
Btw. setBinaryStream() should really throw an SQLException, if
in can not read as many bytes as expected from the InputStream.
Otherwise the application might silently loss data.
Regards
Martin
--
Martin Holz <holz@fiz-chemie.de>
Softwareentwicklung / Vernetztes Studium - Chemie
FIZ CHEMIE Berlin
Franklin Str. 11
D-10587 Berlin