1 package org.columba.core.io; 2 3 import java.io.File ; 4 import java.io.FileNotFoundException ; 5 import java.io.FileOutputStream ; 6 import java.io.IOException ; 7 import java.io.InputStream ; 8 9 public class StreamCacheCopyStream extends PassiveCopyStream { 10 11 StreamCache cache; 12 13 Object key; 14 15 File fileOut; 16 17 24 public StreamCacheCopyStream(InputStream in, Object key, File out, 25 StreamCache cache) throws FileNotFoundException { 26 super(in, new FileOutputStream (out)); 27 28 this.key = key; 29 this.cache = cache; 30 this.fileOut = out; 31 } 32 33 36 @Override 37 public void close() throws IOException { 38 super.close(); 39 40 cache.add(key, fileOut); 41 } 42 43 } 44 | Popular Tags |