public void close() throws IOException { if (lo != null) { try { flush(); lo.close(); lo = null; } catch (SQLException se) { throw new IOException(se.toString()); } } }
/** * 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()); } } }
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()); } }
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()); } }
/** * 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(); } } }
/** * 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()); } } }
/** * 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()); } } }
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()); } }
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()); } }