我想写入流并立即使用它,而不是将其写入文件并读取。文件不是线程安全的,我认为它可能会影响性能。
//set property to an existing file
prop.setProperty("$quoteValidity",""no");
prop.setProperty("$date", "today");
prop.setProperty("$quantitySum", Integer.toString(quantitySum));
//store it in temporary location
prop.store(new FileOutputStream("<Temp file location>"), null);
//open that temp file as stream
InputStream propfile = new FileInputStream("<Temp file location>");
List<Order> orderList = XmlToList.makeOrderFromNodeList(orderNode);
//use that temp file
Testground.generateXlsx(propfile,orderList);