summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/postgresql/fastpath/FastpathArg.java
diff options
context:
space:
mode:
authorBruce Momjian2001-02-13 16:14:40 +0000
committerBruce Momjian2001-02-13 16:14:40 +0000
commit934c5b841edb9fda9ef3d25196c3adaef6cdb935 (patch)
treed0dbf485aafc10b26ae14e48b678c77dede35ab6 /src/interfaces/jdbc/postgresql/fastpath/FastpathArg.java
parent730d1c0dd070055a17358f87ca463979d7e40eec (diff)
Remove postgresql jdbc files, per Peter Mount.
Diffstat (limited to 'src/interfaces/jdbc/postgresql/fastpath/FastpathArg.java')
-rw-r--r--src/interfaces/jdbc/postgresql/fastpath/FastpathArg.java106
1 files changed, 0 insertions, 106 deletions
diff --git a/src/interfaces/jdbc/postgresql/fastpath/FastpathArg.java b/src/interfaces/jdbc/postgresql/fastpath/FastpathArg.java
deleted file mode 100644
index 32c62d761cd..00000000000
--- a/src/interfaces/jdbc/postgresql/fastpath/FastpathArg.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package postgresql.fastpath;
-
-import java.io.*;
-import java.lang.*;
-import java.net.*;
-import java.util.*;
-import java.sql.*;
-import postgresql.util.*;
-
-/**
- * Each fastpath call requires an array of arguments, the number and type
- * dependent on the function being called.
- *
- * <p>This class implements methods needed to provide this capability.
- *
- * <p>For an example on how to use this, refer to the postgresql.largeobject
- * package
- *
- * @see postgresql.fastpath.Fastpath
- * @see postgresql.largeobject.LargeObjectManager
- * @see postgresql.largeobject.LargeObject
- */
-public class FastpathArg
-{
- /**
- * Type of argument, true=integer, false=byte[]
- */
- public boolean type;
-
- /**
- * Integer value if type=true
- */
- public int value;
-
- /**
- * Byte value if type=false;
- */
- public byte[] bytes;
-
- /**
- * Constructs an argument that consists of an integer value
- * @param value int value to set
- */
- public FastpathArg(int value)
- {
- type=true;
- this.value=value;
- }
-
- /**
- * Constructs an argument that consists of an array of bytes
- * @param bytes array to store
- */
- public FastpathArg(byte bytes[])
- {
- type=false;
- this.bytes=bytes;
- }
-
- /**
- * Constructs an argument that consists of part of a byte array
- * @param buf source array
- * @param off offset within array
- * @param len length of data to include
- */
- public FastpathArg(byte buf[],int off,int len)
- {
- type=false;
- bytes = new byte[len];
- System.arraycopy(buf,off,bytes,0,len);
- }
-
- /**
- * Constructs an argument that consists of a String.
- * @param s String to store
- */
- public FastpathArg(String s)
- {
- this(s.getBytes());
- }
-
- /**
- * This sends this argument down the network stream.
- *
- * <p>The stream sent consists of the length.int4 then the contents.
- *
- * <p><b>Note:</b> This is called from Fastpath, and cannot be called from
- * client code.
- *
- * @param s output stream
- * @exception IOException if something failed on the network stream
- */
- protected void send(postgresql.PG_Stream s) throws IOException
- {
- if(type) {
- // argument is an integer
- s.SendInteger(4,4); // size of an integer
- s.SendInteger(value,4); // integer value of argument
- } else {
- // argument is a byte array
- s.SendInteger(bytes.length,4); // size of array
- s.Send(bytes);
- }
- }
-}
-