diff options
author | Marc G. Fournier | 1998-01-11 21:14:56 +0000 |
---|---|---|
committer | Marc G. Fournier | 1998-01-11 21:14:56 +0000 |
commit | ba977c086c01726affcc96219a79584a11ccc78e (patch) | |
tree | 209fc13fa5b540fdaf17711a26338ad6a35e6367 /src/interfaces/jdbc/postgresql/PG_Stream.java | |
parent | 4bad5be7bc7fa1ea973e0b83046b82f9fd5984c5 (diff) |
Peter's Mega-Patch for JDBC...
see README_6.3 for list of changes
Diffstat (limited to 'src/interfaces/jdbc/postgresql/PG_Stream.java')
-rw-r--r-- | src/interfaces/jdbc/postgresql/PG_Stream.java | 36 |
1 files changed, 36 insertions, 0 deletions
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 @@ -71,6 +71,28 @@ public class PG_Stream } /** + * 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 * * @param buf The array of bytes to be sent @@ -296,6 +318,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 * * @exception IOException if a IO Error occurs |