似乎解决了泛型和序列化之间的小不支持的ArrayListSerializer

其实应该用继承的,懒了。

package net.gerhut.gymsystem.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;

public class ArrayListSerializer<T extends Serializable> {
    public void writeArrayList(ArrayList<T> ary, OutputStream out) throws IOException
	{
		ObjectOutputStream ous = new ObjectOutputStream(out);
		ous.writeInt(ary.size());
		for(Object obj : ary)
			ous.writeObject(obj);
		ous.close();
	}
	@SuppressWarnings("unchecked")
	public void readArrayList(ArrayList<T> ary, InputStream in) throws IOException, ClassNotFoundException
	{
		ObjectInputStream ins = new ObjectInputStream(in);
		ary.clear();
		int len = ins.readInt();
		for(int i=0;i<len;i++)
			ary.add((T)ins.readObject());
		ins.close();
	}
}