*** AbstractJdbc1Statement.java.orig	2004-01-07 14:09:31.000000000 +0100
--- AbstractJdbc1Statement.java	2004-01-07 14:21:28.000000000 +0100
***************
*** 1466,1477 ****
  			//handling very large values.  Thus the implementation ends up calling
  			//setBytes() since there is no current way to stream the value to the server
  			byte[] l_bytes = new byte[length];
! 			int l_bytesRead;
! 			try
  			{
! 				l_bytesRead = x.read(l_bytes, 0, length);
! 			}
! 			catch (IOException l_ioe)
  			{
  				throw new PSQLException("postgresql.unusual", PSQLState.UNEXPECTED_ERROR, l_ioe);
  			}
--- 1466,1482 ----
  			//handling very large values.  Thus the implementation ends up calling
  			//setBytes() since there is no current way to stream the value to the server
  			byte[] l_bytes = new byte[length];
! 			int l_bytesRead = 0;
! 			try 
  			{
! 			    while (true)
! 			    {
! 				int n =  x.read(l_bytes, l_bytesRead, length - l_bytesRead);
! 				if (n == -1) break;
! 				l_bytesRead += n;
! 			    }
! 			
! 			} catch (IOException l_ioe)
  			{
  				throw new PSQLException("postgresql.unusual", PSQLState.UNEXPECTED_ERROR, l_ioe);
  			}
