@@ -0,0 +1,1158 @@
+/**%0A * %0A */%0Apackage com.rana.cache;%0A%0Aimport java.beans.XMLEncoder;%0Aimport java.io.File;%0Aimport java.io.FileNotFoundException;%0Aimport java.io.FileOutputStream;%0Aimport java.io.Serializable;%0A%0A/**%0A * @author pramod_rana7%0A *%0A */%0Apublic class CacheWrite implements Serializable %7B%0A%0A%09/**%0A%09 * %0A%09 */%0A%09private static final long serialVersionUID = 1L;%0A%0A%09/**%0A%09 * @throws FileNotFoundException %0A%09 * %0A%09 */%0A%09public CacheWrite(File paramFile) throws FileNotFoundException %7B%0A%09%09this.encode = new XMLEncoder(new FileOutputStream(paramFile));%0A%09%09this.size=0;%0A%09%7D%0A%09%0A%09public void write(Object paramObject)%7B%0A%09%09this.encode.writeObject(paramObject);%0A%09%09this.encode.flush();%0A%09%09this.size++;%0A%09%7D%0A%09%0A%09/**%0A%09 * close the cache writer when the writing finish%0A%09 */%0A%09public void close()%7B%0A%09%09if(this.encode!=null)%7B%0A%09%09%09this.encode.flush();%0A%09%09%09this.encode.close();%0A%09%09%09this.encode=null;%0A%09%09%7D%0A%09%7D%0A%09%0A%09/* (non-Javadoc)%0A%09 * @see java.lang.Object#finalize()%0A%09 */%0A%09@Override%0A%09protected void finalize() throws Throwable %7B%0A%09%09this.close();%0A%09%09super.finalize();%0A%09%7D%0A%09public int getSize()%7B%0A%09%09return this.size;%0A%09%7D%0A%09%0A%09/** encoding **/%0A%09private XMLEncoder encode;%0A%09%0A%09/** Counting Number of input **/%0A%09private int size;%0A%7D%0A

Create cacheWrite.java