1 19 package com.mysql.jdbc; 20 21 import java.io.ByteArrayOutputStream ; 22 import java.io.IOException ; 23 24 25 31 class WatchableOutputStream extends ByteArrayOutputStream { 32 private OutputStreamWatcher watcher; 33 34 39 public void setWatcher(OutputStreamWatcher watcher) { 40 this.watcher = watcher; 41 } 42 43 46 public void close() throws IOException { 47 super.close(); 48 49 if (this.watcher != null) { 50 this.watcher.streamClosed(toByteArray()); 51 } 52 } 53 } 54 | Popular Tags |