Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在使用 XInclude 来合并 XML 文件。但是,我将这些 XML 从文件系统移动到将它们保存为字符串的数据库。在不使用文件作为中介的情况下合并这些 XML 字符串的最佳方法是什么?
您需要将文件的输入流重定向到数据库的输出流。为了合并输入流,只需使用java.io.SequenceInputStream(i1, i2)
java.io.SequenceInputStream(i1, i2)
new SequenceInputStream(new FileInputStream(xmlFile1), new FileInputStream(xmlFile2)) // use merged inputStream