Esempio n. 1
0
 public synchronized void streamClosed(WatchableOutputStream out) {
   int streamSize = out.size();
   if (streamSize < this.binaryData.length) {
     out.write(this.binaryData, streamSize, this.binaryData.length - streamSize);
   }
   this.binaryData = out.toByteArray();
 }
Esempio n. 2
0
 public synchronized OutputStream setBinaryStream(long indexToWriteAt) throws SQLException {
   checkClosed();
   if (indexToWriteAt < 1L) {
     throw SQLError.createSQLException(
         Messages.getString("Blob.0"), "S1009", this.exceptionInterceptor);
   }
   WatchableOutputStream bytesOut = new WatchableOutputStream();
   bytesOut.setWatcher(this);
   if (indexToWriteAt > 0L) {
     bytesOut.write(this.binaryData, 0, (int) (indexToWriteAt - 1L));
   }
   return bytesOut;
 }