我想在其他目录中包含类文件,而不是主类的目录.
如果我把这些目录放入它的Class-Path属性MANIFEST.MF不起作用.
为什么?除了将这些类打包到jar文件中之外,还有其他解决方案吗?
以下代码摘自核心Java卷1的java Web start章节.
ByteArrayOutputStream out = new ByteArrayOutputStream();
PrintStream printOut = new PrintStream(out);
printOut.print(panel.getText());
//panel.getText() return a String
InputStream data = new ByteArrayInputStream(out.toByteArray());
FileSaveService service = (FileSaveService) ServiceManager
.lookup("javax.jnlp.FileSaveService");
service.saveFileDialog(".", new String[] { "txt" }, data, "calc.txt");
Run Code Online (Sandbox Code Playgroud)
创建了四个对象,流重定向三次.有没有其他方法可以使用jnlp api将数据写入文件?InputStream和ByteArrayInputStream之间有什么区别?