one method:
String filename = "test/testfiles/testDAOUpload.xml";
File testfile = new File(filename);
System.out.println(testfile.getAbsolutePath());
FileInputStream fileinput = new FileInputStream(testfile
.getAbsolutePath());
int x = fileinput.available();
byte b[] = new byte[x];
fileinput.read(b);
String xmlDocument = new String(b);
System.out.println(xmlDocument);
收藏到:
Del.icio.us
本文展示了一段Java代码示例,该示例演示了如何从本地文件系统中读取一个名为testDAOUpload.xml的XML文件,并将其内容转换为字符串进行输出。
212

被折叠的 条评论
为什么被折叠?



