public static Object fromXML(FileInputStream fileIn, Class className) throws Exception {
doctypeDeclaration = null; // Clear the DOCTYPE declaration variable
//ByteArrayInputStream xmlData = new ByteArrayInputStream(xml.getBytes());
JOXBeanInputStream joxIn = new MyJOXBeanInputStream(fileIn);
try {
return (Object) joxIn.readObject(className);
/*
TestBean testBean = (TestBean) joxIn.readObject(
TestBean.class);*/
} catch (IOException exc) {
exc.printStackTrace();
return null;
} finally {
try {
//xmlData.close();
fileIn.close();
joxIn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}