From ba977c086c01726affcc96219a79584a11ccc78e Mon Sep 17 00:00:00 2001 From: "Marc G. Fournier" Date: Sun, 11 Jan 1998 21:14:56 +0000 Subject: Peter's Mega-Patch for JDBC... see README_6.3 for list of changes --- src/interfaces/jdbc/postgresql/PG_Stream.java | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/interfaces/jdbc/postgresql/PG_Stream.java') diff --git a/src/interfaces/jdbc/postgresql/PG_Stream.java b/src/interfaces/jdbc/postgresql/PG_Stream.java index 59804c6dc6b..8c5f5215614 100644 --- a/src/interfaces/jdbc/postgresql/PG_Stream.java +++ b/src/interfaces/jdbc/postgresql/PG_Stream.java @@ -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 * -- cgit v1.2.3