我正在尝试从 OSGI 包中读取资源文件,以下是我的代码片段:
InputStream in;
URL url;
BundleContext bc = FrameworkUtil.getBundle(ReportUtil.class).getBundleContext(); // ReportUtil is the name of the class
url = bc.getBundle().getResource("sample_report.jrxml"); // URL is returned as /sample_report.jrxml
InputStream dataStream ;
dataStream= url.openStream();// Input Stream is java.util.zip.ZipFile$ZipFileInflaterInputStream@d112491
java.util.zip.ZipFile$ZipFileInflaterInputStream 的含义是什么?
我需要在 jasper 编译器报告中使用将输入作为 InputStream 的数据流,有没有办法将 java.util.zip.ZipFile$ZipFileInflaterInputStream 转换为 InputStream