/** * <p>Returns an {@link InputStream} from this object.</p> * * <p>This {@link InputStream} can then be used in any method that requires an InputStream.</p> * * @return {@link InputStream} from this object * @throws SQLException if a database-access error occurs. */ public InputStream getInputStream() throws SQLException { return new BlobInputStream(this, 4096); }
/** * Repositions this stream to the position at the time the * <code>mark</code> method was last called on this input stream. * NB: If mark is not called we move to the begining. * @see java.io.InputStream#mark(int) * @see java.io.IOException */ public synchronized void reset() throws IOException { checkClosed(); try { lo.seek(mpos); } catch (SQLException se) { throw new IOException(se.toString()); } }
/** * The minimum required to implement input stream. */ public int read() throws java.io.IOException { checkClosed(); try { if (limit > 0 && apos >= limit) { return -1; } if (buffer == null || bpos >= buffer.length) { buffer = lo.read(bsize); bpos = 0; } // Handle EOF if (bpos >= buffer.length) { return -1; } int ret = (buffer[bpos] & 0x7F); if ((buffer[bpos] & 0x80) == 0x80) { ret |= 0x80; } bpos++; apos++; return ret; } catch (SQLException se) { throw new IOException(se.toString()); } }
/** * Returns an {@link InputStream} from this object, that will limit the amount of data that is * visible. * * @param limit maximum number of bytes the resulting stream will serve * @return {@link InputStream} from this object * @throws SQLException if a database-access error occurs. */ public InputStream getInputStream(long limit) throws SQLException { return new BlobInputStream(this, 4096, limit); }
/** * Returns an InputStream from this object. * * <p>This InputStream can then be used in any method that requires an * InputStream. * * @exception SQLException if a database-access error occurs. */ public InputStream getInputStream() throws SQLException { return new BlobInputStream(this, 4096); }
/** * Repositions this stream to the position at the time the <code>mark</code> method was last * called on this input stream. NB: If mark is not called we move to the beginning. * * @see java.io.InputStream#mark(int) * @see java.io.IOException */ public synchronized void reset() throws IOException { checkClosed(); try { if (mpos <= Integer.MAX_VALUE) { lo.seek((int)mpos); } else { lo.seek64(mpos, LargeObject.SEEK_SET); } buffer = null; apos = mpos; } catch (SQLException se) { throw new IOException(se.toString()); } }
/** * Returns an InputStream from this object. * * <p>This InputStream can then be used in any method that requires an * InputStream. * * @exception SQLException if a database-access error occurs. */ public InputStream getInputStream() throws SQLException { return new BlobInputStream(this, 4096); }
/** * Repositions this stream to the position at the time the * <code>mark</code> method was last called on this input stream. * NB: If mark is not called we move to the begining. * @see java.io.InputStream#mark(int) * @see java.io.IOException */ public synchronized void reset() throws IOException { checkClosed(); try { lo.seek(mpos); } catch (SQLException se) { throw new IOException(se.toString()); } }
/** * Returns an InputStream from this object. * * <p>This InputStream can then be used in any method that requires an * InputStream. * * @exception SQLException if a database-access error occurs. */ public InputStream getInputStream() throws SQLException { return new BlobInputStream(this, 4096); }
/** * Repositions this stream to the position at the time the * <code>mark</code> method was last called on this input stream. * NB: If mark is not called we move to the begining. * @see java.io.InputStream#mark(int) * @see java.io.IOException */ public synchronized void reset() throws IOException { checkClosed(); try { lo.seek(mpos); } catch (SQLException se) { throw new IOException(se.toString()); } }