remove one

This commit is contained in:
coderfengyun 2013-07-19 20:07:35 +08:00
parent 272a63d31c
commit b1422b22a1
1 changed files with 0 additions and 36 deletions

View File

@ -1,36 +0,0 @@
package org.bench4q.master.entity;
import java.beans.XMLDecoder;
import java.beans.XMLEncoder;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class XMLSerial {
public static <T extends Serializable> void writeObjectToXML(OutputStream out, T obj){
XMLEncoder xmlEncoder = null;
try{
xmlEncoder = new XMLEncoder(out);
xmlEncoder.writeObject(obj);
}finally{
if(null != xmlEncoder)
xmlEncoder.close();
}
}
@SuppressWarnings("unchecked")
public static <T extends Serializable> T readObjectFromXML(InputStream in){
T obj = null;
XMLDecoder xmlDecoder = null;
try{
xmlDecoder = new XMLDecoder(in);
obj = (T) xmlDecoder.readObject();
}finally{
if(null != xmlDecoder)
xmlDecoder.close();
}
return obj;
}
}