#java again :) Serializing ftw :P
Java again :) Serializing FTW :P
public class C
{
public static class Ci implements Serializable {
public Object o;
}
public static void main(String[] a) throws IOException, InterruptedException
{
List l = new ArrayList<>();
ObjectOutputStream o = new ObjectOutputStream(new OutputStream(){
public void write(int b) {/*DEVNULL*/}
});//ew
FileOutputStream(new File("C:\\cg\\out")));
Ci c = new Ci();
Ci c2=c2 = null;
int i=0;i = 0;
for (;;) {
{i++;if i++;
if (i%100000==0i % 100000 == 0) {
System.out.println("Serializing...");
;oo.writeObject(c);
o = new ObjectOutputStream(new OutputStream(){
public void write(int b) {/*DEVNULL*/}
});
Thread.sleep(1000);
}
if (false)
break;
c2=c;
c=newc2 = c;
c = new Ci();
c.o=c2;o = c2;
}
}
}
Googling a bit around should tell how this one works :P
The modulo operator is to reduce workload and speed the thing up.