/**
* 克隆
*
* @param <T>
* @param t
* @return
*/
public static final <T> T clone(T t) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(baos);
out.writeObject(t);
out.close();
ByteArrayInputStream bin = new ByteArrayInputStream(baos
.toByteArray());
ObjectInputStream in = new ObjectInputStream(bin);
Object clone = in.readObject();
in.close();
return (T) (clone);
} catch (ClassNotFoundException e) {
throw new InternalError(e.toString());
} catch (StreamCorruptedException e) {
throw new InternalError(e.toString());
} catch (IOException e) {
throw new InternalError(e.toString());
}
}