mpos = lo.tell();
/** * <p>This method is inefficient, as the only way to find out the size of the object is to seek to * the end, record the current position, then return to the original position.</p> * * <p>A better method will be found in the future.</p> * * @return the size of the large object * @throws SQLException if a database-access error occurs. */ public int size() throws SQLException { int cp = tell(); seek(0, SEEK_END); int sz = tell(); seek(cp, SEEK_SET); return sz; }
/** * This method is inefficient, as the only way to find out the size of * the object is to seek to the end, record the current position, then * return to the original position. * * <p>A better method will be found in the future. * * @return the size of the large object * @exception SQLException if a database-access error occurs. */ public int size() throws SQLException { int cp = tell(); seek(0, SEEK_END); int sz = tell(); seek(cp, SEEK_SET); return sz; }
protected synchronized LargeObject getLo(boolean forWrite) throws SQLException { if (this.currentLo != null) { if (forWrite && !currentLoIsWriteable) { // Reopen the stream in read-write, at the same pos. int currentPos = this.currentLo.tell(); LargeObjectManager lom = conn.getLargeObjectAPI(); LargeObject newLo = lom.open(oid, LargeObjectManager.READWRITE); this.subLOs.add(this.currentLo); this.currentLo = newLo; if (currentPos != 0) { this.currentLo.seek(currentPos); } } return this.currentLo; } LargeObjectManager lom = conn.getLargeObjectAPI(); currentLo = lom.open(oid, forWrite ? LargeObjectManager.READWRITE : LargeObjectManager.READ); currentLoIsWriteable = forWrite; return currentLo; }
mpos = lo.tell();
/** * This method is inefficient, as the only way to find out the size of * the object is to seek to the end, record the current position, then * return to the original position. * * <p>A better method will be found in the future. * * @return the size of the large object * @exception SQLException if a database-access error occurs. */ public int size() throws SQLException { int cp = tell(); seek(0, SEEK_END); int sz = tell(); seek(cp, SEEK_SET); return sz; }
/** * This method is inefficient, as the only way to find out the size of * the object is to seek to the end, record the current position, then * return to the original position. * * <p>A better method will be found in the future. * * @return the size of the large object * @exception SQLException if a database-access error occurs. */ public int size() throws SQLException { int cp = tell(); seek(0, SEEK_END); int sz = tell(); seek(cp, SEEK_SET); return sz; }