mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
Peter's Mega-Patch for JDBC...
see README_6.3 for list of changes
This commit is contained in:
@ -70,6 +70,28 @@ public class PG_Stream
|
||||
Send(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an integer to the back end in reverse order.
|
||||
*
|
||||
* This is required when the backend uses the routines in the
|
||||
* src/backend/libpq/pqcomprim.c module.
|
||||
*
|
||||
* @param val the integer to be sent
|
||||
* @param siz the length of the integer in bytes (size of structure)
|
||||
* @exception IOException if an I/O error occurs
|
||||
*/
|
||||
public void SendIntegerReverse(int val, int siz) throws IOException
|
||||
{
|
||||
byte[] buf = new byte[siz];
|
||||
int p=0;
|
||||
while (siz-- > 0)
|
||||
{
|
||||
buf[p++] = (byte)(val & 0xff);
|
||||
val >>= 8;
|
||||
}
|
||||
Send(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send an array of bytes to the backend
|
||||
*
|
||||
@ -295,6 +317,20 @@ public class PG_Stream
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This flushes any pending output to the backend. It is used primarily
|
||||
* by the Fastpath code.
|
||||
* @exception SQLException if an I/O error occurs
|
||||
*/
|
||||
public void flush() throws SQLException
|
||||
{
|
||||
try {
|
||||
pg_output.flush();
|
||||
} catch (IOException e) {
|
||||
throw new SQLException("Error flushing output: " + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the connection
|
||||
*
|
||||
|
Reference in New Issue
Block a user