Codota Logo
org.postgresql.fastpath
Code IndexAdd Codota to your IDE (free)

How to use org.postgresql.fastpath

Best Java code snippets using org.postgresql.fastpath (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: org.postgresql/postgresql

/**
 * @return the current position within the object
 * @throws SQLException if a database-access error occurs.
 */
public int tell() throws SQLException {
 FastpathArg[] args = new FastpathArg[1];
 args[0] = new FastpathArg(fd);
 return fp.getInteger("lo_tell", args);
}
origin: org.postgresql/postgresql

/**
 * Writes an array to the object.
 *
 * @param buf array to write
 * @throws SQLException if a database-access error occurs.
 */
public void write(byte[] buf) throws SQLException {
 FastpathArg[] args = new FastpathArg[2];
 args[0] = new FastpathArg(fd);
 args[1] = new FastpathArg(buf);
 fp.fastpath("lowrite", args);
}
origin: org.postgresql/postgresql

/**
 * @return the current position within the object
 * @throws SQLException if a database-access error occurs.
 */
public long tell64() throws SQLException {
 FastpathArg[] args = new FastpathArg[1];
 args[0] = new FastpathArg(fd);
 return fp.getLong("lo_tell64", args);
}
origin: org.postgresql/postgresql

/**
 * This deletes a large object.
 *
 * @param oid describing object to delete
 * @throws SQLException on error
 */
public void delete(long oid) throws SQLException {
 FastpathArg[] args = new FastpathArg[1];
 args[0] = Fastpath.createOIDArg(oid);
 fp.fastpath("lo_unlink", args);
}
origin: org.postgresql/postgresql

/**
 * Reads some data from the object, and return as a byte[] array.
 *
 * @param len number of bytes to read
 * @return byte[] array containing data read
 * @throws SQLException if a database-access error occurs.
 */
public byte[] read(int len) throws SQLException {
 // This is the original method, where the entire block (len bytes)
 // is retrieved in one go.
 FastpathArg[] args = new FastpathArg[2];
 args[0] = new FastpathArg(fd);
 args[1] = new FastpathArg(len);
 return fp.getData("loread", args);
}
origin: org.postgresql/postgresql

/**
 * This convenience method assumes that the return value is not an Integer.
 *
 * @param name Function name
 * @param args Function arguments
 * @return byte[] array containing result
 * @throws SQLException if a database-access error occurs or no result
 */
public byte[] getData(String name, FastpathArg[] args) throws SQLException {
 return fastpath(name, args);
}
origin: postgresql/postgresql

/**
 * Creates a FastpathArg with an oid parameter.
 * This is here instead of a constructor of FastpathArg
 * because the constructor can't tell the difference between
 * an long that's really int8 and a long thats an oid.
 */
public static FastpathArg createOIDArg(long oid)
{
  if (oid > Integer.MAX_VALUE)
    oid -= NUM_OIDS;
  return new FastpathArg((int)oid);
}
origin: postgresql/postgresql

/**
 * This convenience method assumes that the return value is an oid.
 * @param name Function name
 * @param args Function arguments
 * @exception SQLException if a database-access error occurs or no result
 */
public long getOID(String name, FastpathArg[] args) throws SQLException
{
  long oid = getInteger(name, args);
  if (oid < 0)
    oid += NUM_OIDS;
  return oid;
}
origin: org.postgresql/postgresql

/**
 * Truncates the large object to the given length in bytes. If the number of bytes is larger than
 * the current large object length, the large object will be filled with zero bytes. This method
 * does not modify the current file offset.
 *
 * @param len given length in bytes
 * @throws SQLException if something goes wrong
 */
public void truncate64(long len) throws SQLException {
 FastpathArg[] args = new FastpathArg[2];
 args[0] = new FastpathArg(fd);
 args[1] = new FastpathArg(len);
 fp.getInteger("lo_truncate64", args);
}
origin: org.postgresql/postgresql

/**
 * Writes some data from an array to the object.
 *
 * @param buf destination array
 * @param off offset within array
 * @param len number of bytes to write
 * @throws SQLException if a database-access error occurs.
 */
public void write(byte[] buf, int off, int len) throws SQLException {
 FastpathArg[] args = new FastpathArg[2];
 args[0] = new FastpathArg(fd);
 args[1] = new FastpathArg(buf, off, len);
 fp.fastpath("lowrite", args);
}
origin: postgresql/postgresql

/**
 * This deletes a large object.
 *
 * @param oid describing object to delete
 * @exception SQLException on error
 */
public void delete(long oid) throws SQLException
{
  FastpathArg args[] = new FastpathArg[1];
  args[0] = Fastpath.createOIDArg(oid);
  fp.fastpath("lo_unlink", false, args);
}
origin: postgresql/postgresql

/**
 * Reads some data from the object, and return as a byte[] array
 *
 * @param len number of bytes to read
 * @return byte[] array containing data read
 * @exception SQLException if a database-access error occurs.
 */
public byte[] read(int len) throws SQLException
{
  // This is the original method, where the entire block (len bytes)
  // is retrieved in one go.
  FastpathArg args[] = new FastpathArg[2];
  args[0] = new FastpathArg(fd);
  args[1] = new FastpathArg(len);
  return fp.getData("loread", args);
}
origin: postgresql/postgresql

/**
 * This convenience method assumes that the return value is not an Integer
 * @param name Function name
 * @param args Function arguments
 * @return byte[] array containing result
 * @exception SQLException if a database-access error occurs or no result
 */
public byte[] getData(String name, FastpathArg[] args) throws SQLException
{
  return (byte[])fastpath(name, false, args);
}
origin: org.postgresql/postgresql

/**
 * Creates a FastpathArg with an oid parameter. This is here instead of a constructor of
 * FastpathArg because the constructor can't tell the difference between an long that's really
 * int8 and a long thats an oid.
 *
 * @param oid input oid
 * @return FastpathArg with an oid parameter
 */
public static FastpathArg createOIDArg(long oid) {
 if (oid > Integer.MAX_VALUE) {
  oid -= NUM_OIDS;
 }
 return new FastpathArg((int) oid);
}
origin: postgresql/postgresql

/**
 * @return the current position within the object
 * @exception SQLException if a database-access error occurs.
 */
public int tell() throws SQLException
{
  FastpathArg args[] = new FastpathArg[1];
  args[0] = new FastpathArg(fd);
  return fp.getInteger("lo_tell", args);
}
origin: org.postgresql/postgresql

/**
 * Sets the current position within the object using 64-bit value (9.3+).
 *
 * @param pos position within object
 * @param ref Either SEEK_SET, SEEK_CUR or SEEK_END
 * @throws SQLException if a database-access error occurs.
 */
public void seek64(long pos, int ref) throws SQLException {
 FastpathArg[] args = new FastpathArg[3];
 args[0] = new FastpathArg(fd);
 args[1] = new FastpathArg(pos);
 args[2] = new FastpathArg(ref);
 fp.fastpath("lo_lseek64", args);
}
origin: org.postgresql/postgresql

/**
 * Truncates the large object to the given length in bytes. If the number of bytes is larger than
 * the current large object length, the large object will be filled with zero bytes. This method
 * does not modify the current file offset.
 *
 * @param len given length in bytes
 * @throws SQLException if something goes wrong
 */
public void truncate(int len) throws SQLException {
 FastpathArg[] args = new FastpathArg[2];
 args[0] = new FastpathArg(fd);
 args[1] = new FastpathArg(len);
 fp.getInteger("lo_truncate", args);
}
origin: postgresql/postgresql

/**
 * Writes an array to the object
 *
 * @param buf array to write
 * @exception SQLException if a database-access error occurs.
 */
public void write(byte buf[]) throws SQLException
{
  FastpathArg args[] = new FastpathArg[2];
  args[0] = new FastpathArg(fd);
  args[1] = new FastpathArg(buf);
  fp.fastpath("lowrite", false, args);
}
origin: postgresql/postgresql

/**
 * Truncates the large object to the given length in bytes.
 * If the number of bytes is larger than the current large
 * object length, the large object will be filled with zero
 * bytes.  This method does not modify the current file offset.
 */
public void truncate(int len) throws SQLException
{
  FastpathArg args[] = new FastpathArg[2];
  args[0] = new FastpathArg(fd);
  args[1] = new FastpathArg(len);
  fp.getInteger("lo_truncate", args);
}
origin: postgresql/postgresql

/**
 * Writes some data from an array to the object
 *
 * @param buf destination array
 * @param off offset within array
 * @param len number of bytes to write
 * @exception SQLException if a database-access error occurs.
 */
public void write(byte buf[], int off, int len) throws SQLException
{
  FastpathArg args[] = new FastpathArg[2];
  args[0] = new FastpathArg(fd);
  args[1] = new FastpathArg(buf, off, len);
  fp.fastpath("lowrite", false, args);
}
org.postgresql.fastpath

Most used classes

  • Fastpath
    This class implements the Fastpath api.This is a means of executing functions embedded in the backen
  • FastpathArg
    Each fastpath call requires an array of arguments, the number and type dependent on the function bei
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now