congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
BlobOutputStream.flush
Code IndexAdd Tabnine to your IDE (free)

How to use
flush
method
in
org.postgresql.largeobject.BlobOutputStream

Best Java code snippets using org.postgresql.largeobject.BlobOutputStream.flush (Showing top 12 results out of 315)

origin: org.postgresql/postgresql

public void close() throws IOException {
 if (lo != null) {
  try {
   flush();
   lo.close();
   lo = null;
  } catch (SQLException se) {
   throw new IOException(se.toString());
  }
 }
}
origin: postgresql/postgresql

/**
 * Closes this output stream and releases any system resources
 * associated with this stream. The general contract of <code>close</code>
 * is that it closes the output stream. A closed stream cannot perform
 * output operations and cannot be reopened.
 * <p>
 * The <code>close</code> method of <code>OutputStream</code> does nothing.
 *
 * @exception  IOException if an I/O error occurs.
 */
public void close() throws IOException
{
  if (lo != null) {
    try
    {
      flush();
      lo.close();
      lo = null;
    }
    catch (SQLException se)
    {
      throw new IOException(se.toString());
    }
  }
}
origin: org.postgresql/postgresql

public void write(byte[] buf, int off, int len) throws java.io.IOException {
 checkClosed();
 try {
  // If we have any internally buffered data, send it first
  if (bpos > 0) {
   flush();
  }
  if (off == 0 && len == buf.length) {
   lo.write(buf); // save a buffer creation and copy since full buffer written
  } else {
   lo.write(buf, off, len);
  }
 } catch (SQLException se) {
  throw new IOException(se.toString());
 }
}
origin: postgresql/postgresql

public void write(byte[] buf, int off, int len) throws java.io.IOException
{
  checkClosed();
  try
  {
    // If we have any internally buffered data, send it first
    if ( bpos > 0 )
      flush();
    if ( off == 0 && len == buf.length )
      lo.write(buf); // save a buffer creation and copy since full buffer written
    else
      lo.write(buf, off, len);
  }
  catch (SQLException se)
  {
    throw new IOException(se.toString());
  }
}
origin: postgresql/postgresql

os.flush();
origin: org.postgresql/postgresql

/**
 * This method closes the object. You must not call methods in this object after this is called.
 *
 * @throws SQLException if a database-access error occurs.
 */
public void close() throws SQLException {
 if (!closed) {
  // flush any open output streams
  if (os != null) {
   try {
    // we can't call os.close() otherwise we go into an infinite loop!
    os.flush();
   } catch (IOException ioe) {
    throw new PSQLException("Exception flushing output stream", PSQLState.DATA_ERROR, ioe);
   } finally {
    os = null;
   }
  }
  // finally close
  FastpathArg[] args = new FastpathArg[1];
  args[0] = new FastpathArg(fd);
  fp.fastpath("lo_close", args); // true here as we dont care!!
  closed = true;
  if (this.commitOnClose) {
   this.conn.commit();
  }
 }
}
origin: org.ancoron.postgresql/org.postgresql.osgi

/**
 * Closes this output stream and releases any system resources
 * associated with this stream. The general contract of <code>close</code>
 * is that it closes the output stream. A closed stream cannot perform
 * output operations and cannot be reopened.
 * <p>
 * The <code>close</code> method of <code>OutputStream</code> does nothing.
 *
 * @exception  IOException if an I/O error occurs.
 */
public void close() throws IOException
{
  if (lo != null) {
    try
    {
      flush();
      lo.close();
      lo = null;
    }
    catch (SQLException se)
    {
      throw new IOException(se.toString());
    }
  }
}
origin: org.ancoron.postgresql/org.postgresql

/**
 * Closes this output stream and releases any system resources
 * associated with this stream. The general contract of <code>close</code>
 * is that it closes the output stream. A closed stream cannot perform
 * output operations and cannot be reopened.
 * <p>
 * The <code>close</code> method of <code>OutputStream</code> does nothing.
 *
 * @exception  IOException if an I/O error occurs.
 */
public void close() throws IOException
{
  if (lo != null) {
    try
    {
      flush();
      lo.close();
      lo = null;
    }
    catch (SQLException se)
    {
      throw new IOException(se.toString());
    }
  }
}
origin: org.ancoron.postgresql/org.postgresql

public void write(byte[] buf, int off, int len) throws java.io.IOException
{
  checkClosed();
  try
  {
    // If we have any internally buffered data, send it first
    if ( bpos > 0 )
      flush();
    if ( off == 0 && len == buf.length )
      lo.write(buf); // save a buffer creation and copy since full buffer written
    else
      lo.write(buf, off, len);
  }
  catch (SQLException se)
  {
    throw new IOException(se.toString());
  }
}
origin: org.ancoron.postgresql/org.postgresql.osgi

public void write(byte[] buf, int off, int len) throws java.io.IOException
{
  checkClosed();
  try
  {
    // If we have any internally buffered data, send it first
    if ( bpos > 0 )
      flush();
    if ( off == 0 && len == buf.length )
      lo.write(buf); // save a buffer creation and copy since full buffer written
    else
      lo.write(buf, off, len);
  }
  catch (SQLException se)
  {
    throw new IOException(se.toString());
  }
}
origin: org.ancoron.postgresql/org.postgresql

os.flush();
origin: org.ancoron.postgresql/org.postgresql.osgi

os.flush();
org.postgresql.largeobjectBlobOutputStreamflush

Javadoc

Flushes this output stream and forces any buffered output bytes to be written out. The general contract of flush is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.

Popular methods of BlobOutputStream

  • <init>
    Create an OutputStream to a large object.
  • checkClosed

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • getResourceAsStream (ClassLoader)
  • setContentView (Activity)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now