public boolean hasNext() throws SQLException { boolean result = false; if (idx < numBytes) { result = true; } else { numBytes = lo.read(buffer, 0, BUFFER_SIZE); idx = 0; result = (numBytes > 0); } return result; }
/** * Reads some data from the object into an existing array. * * @param buf destination array * @param off offset within array * @param len number of bytes to read * @return the number of bytes actually read * @throws SQLException if a database-access error occurs. */ public int read(byte[] buf, int off, int len) throws SQLException { byte[] b = read(len); if (b.length < len) { len = b.length; } System.arraycopy(b, 0, buf, off, len); return len; }
/** * Reads some data from the object into an existing array * * @param buf destination array * @param off offset within array * @param len number of bytes to read * @return the number of bytes actually read * @exception SQLException if a database-access error occurs. */ public int read(byte buf[], int off, int len) throws SQLException { byte b[] = read(len); if (b.length < len) len = b.length; System.arraycopy(b, 0, buf, off, len); return len; }
public boolean hasNext() throws SQLException { boolean result; if (idx < numBytes) { result = true; } else { numBytes = getLo(false).read(buffer, 0, BUFFER_SIZE); idx = 0; result = (numBytes > 0); } return result; }
public synchronized String getSubString(long i, int j) throws SQLException { assertPosition(i, j); lo.seek((int)i - 1); return new String(lo.read(j)); }
/** * 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()); } }
buffer = lo.read(bsize); bpos = 0;
public synchronized byte[] getBytes(long pos, int length) throws SQLException { assertPosition(pos); lo.seek((int)(pos-1), LargeObject.SEEK_SET); return lo.read(length); }
public synchronized String getSubString(long i, int j) throws SQLException { assertPosition(i, j); getLo(false).seek((int) i - 1); return new String(getLo(false).read(j)); }
public synchronized byte[] getBytes(long pos, int length) throws SQLException { assertPosition(pos); getLo(false).seek((int) (pos - 1), LargeObject.SEEK_SET); return getLo(false).read(length); }
byte buf[] = lob.read(lob.size()); lob.close(); return trimBytes(columnIndex, buf);
public boolean hasNext() throws SQLException { boolean result = false; if (idx < numBytes) { result = true; } else { numBytes = lo.read(buffer, 0, BUFFER_SIZE); idx = 0; result = (numBytes > 0); } return result; }
@Override public int read(byte[] b, int off, int len) throws IOException { try { return obj.read(b, off, len); } catch (SQLException e) { IOException e2 = new IOException("Error reading from database"); e2.initCause(e); throw e2; } }
/** * Reads some data from the object into an existing array * * @param buf destination array * @param off offset within array * @param len number of bytes to read * @return the number of bytes actually read * @exception SQLException if a database-access error occurs. */ public int read(byte buf[], int off, int len) throws SQLException { byte b[] = read(len); if (b.length < len) len = b.length; System.arraycopy(b, 0, buf, off, len); return len; }
/** * Reads some data from the object into an existing array * * @param buf destination array * @param off offset within array * @param len number of bytes to read * @return the number of bytes actually read * @exception SQLException if a database-access error occurs. */ public int read(byte buf[], int off, int len) throws SQLException { byte b[] = read(len); if (b.length < len) len = b.length; System.arraycopy(b, 0, buf, off, len); return len; }
@Override public int read(byte[] b, int off, int len) throws IOException { try { return obj.read(b, off, len); } catch (SQLException e) { IOException e2 = new IOException("Error reading from database"); e2.initCause(e); throw e2; } }
public synchronized String getSubString(long i, int j) throws SQLException { assertPosition(i, j); lo.seek((int)i - 1); return new String(lo.read(j)); }
public synchronized String getSubString(long i, int j) throws SQLException { assertPosition(i, j); lo.seek((int)i - 1); return new String(lo.read(j)); }
public synchronized byte[] getBytes(long pos, int length) throws SQLException { assertPosition(pos); lo.seek((int)(pos-1), LargeObject.SEEK_SET); return lo.read(length); }
public synchronized byte[] getBytes(long pos, int length) throws SQLException { assertPosition(pos); lo.seek((int)(pos-1), LargeObject.SEEK_SET); return lo.read(length); }