示例#1
0
文件: Blob.java 项目: chums122/Spigot
 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();
 }
示例#2
0
文件: Blob.java 项目: chums122/Spigot
 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;
 }