Codota Logo
BlobOutputStream
Code IndexAdd Codota to your IDE (free)

How to use
BlobOutputStream
in
org.postgresql.largeobject

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

  • Common ways to obtain BlobOutputStream
private void myMethod () {
BlobOutputStream b =
  • Codota IconLargeObject largeObject;new BlobOutputStream(largeObject, int1)
  • Smart code suggestions by Codota
}
origin: org.postgresql/postgresql

 /**
  * <p>Returns an {@link OutputStream} to this object.</p>
  *
  * <p>This OutputStream can then be used in any method that requires an OutputStream.</p>
  *
  * @return {@link OutputStream} from this object
  * @throws SQLException if a database-access error occurs.
  */
 public OutputStream getOutputStream() throws SQLException {
  if (os == null) {
   os = new BlobOutputStream(this, 4096);
  }
  return os;
 }
}
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: org.postgresql/postgresql

public void write(int b) throws java.io.IOException {
 checkClosed();
 try {
  if (bpos >= bsize) {
   lo.write(buf);
   bpos = 0;
  }
  buf[bpos++] = (byte) b;
 } catch (SQLException se) {
  throw new IOException(se.toString());
 }
}
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

public void write(int b) throws java.io.IOException
{
  checkClosed();
  try
  {
    if (bpos >= bsize)
    {
      lo.write(buf);
      bpos = 0;
    }
    buf[bpos++] = (byte)b;
  }
  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: 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: org.postgresql/postgresql

/**
 * Flushes this output stream and forces any buffered output bytes to be written out. The general
 * contract of <code>flush</code> 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.
 *
 * @throws IOException if an I/O error occurs.
 */
public void flush() throws IOException {
 checkClosed();
 try {
  if (bpos > 0) {
   lo.write(buf, 0, bpos);
  }
  bpos = 0;
 } catch (SQLException se) {
  throw new IOException(se.toString());
 }
}
origin: postgresql/postgresql

os.flush();
origin: postgresql/postgresql

/**
 * Returns an OutputStream to this object.
 *
 * <p>This OutputStream can then be used in any method that requires an
 * OutputStream.
 *
 * @exception SQLException if a database-access error occurs.
 */
public OutputStream getOutputStream() throws SQLException
{
  if (os == null)
    os = new BlobOutputStream(this, 4096);
  return os;
}
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: postgresql/postgresql

/**
 * Flushes this output stream and forces any buffered output bytes
 * to be written out. The general contract of <code>flush</code> 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.
 *
 * @exception  IOException if an I/O error occurs.
 */
public void flush() throws IOException
{
  checkClosed();
  try
  {
    if (bpos > 0)
      lo.write(buf, 0, bpos);
    bpos = 0;
  }
  catch (SQLException se)
  {
    throw new IOException(se.toString());
  }
}
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

/**
 * Returns an OutputStream to this object.
 *
 * <p>This OutputStream can then be used in any method that requires an
 * OutputStream.
 *
 * @exception SQLException if a database-access error occurs.
 */
public OutputStream getOutputStream() throws SQLException
{
  if (os == null)
    os = new BlobOutputStream(this, 4096);
  return os;
}
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

public void write(int b) throws java.io.IOException
{
  checkClosed();
  try
  {
    if (bpos >= bsize)
    {
      lo.write(buf);
      bpos = 0;
    }
    buf[bpos++] = (byte)b;
  }
  catch (SQLException se)
  {
    throw new IOException(se.toString());
  }
}
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.osgi

/**
 * Returns an OutputStream to this object.
 *
 * <p>This OutputStream can then be used in any method that requires an
 * OutputStream.
 *
 * @exception SQLException if a database-access error occurs.
 */
public OutputStream getOutputStream() throws SQLException
{
  if (os == null)
    os = new BlobOutputStream(this, 4096);
  return os;
}
origin: org.ancoron.postgresql/org.postgresql.osgi

public void write(int b) throws java.io.IOException
{
  checkClosed();
  try
  {
    if (bpos >= bsize)
    {
      lo.write(buf);
      bpos = 0;
    }
    buf[bpos++] = (byte)b;
  }
  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());
    }
  }
}
org.postgresql.largeobjectBlobOutputStream

Javadoc

This implements a basic output stream that writes to a LargeObject.

Most used methods

  • <init>
    Create an OutputStream to a large object.
  • checkClosed
  • flush
    Flushes this output stream and forces any buffered output bytes to be written out. The general contr

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • JList (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
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