remove one
This commit is contained in:
parent
272a63d31c
commit
b1422b22a1
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue