无法找到在Apache WorkbookFactory close()方法 [英] cant find close() method on Apache WorkbookFactory

查看:2300
本文介绍了无法找到在Apache WorkbookFactory close()方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读到阿帕奇WorkbookFactory

导都说完成后关闭工作簿。
工作簿使用后应关闭

但我没有close方法将其关闭。

怎么会被关闭?

 工作簿WB = WorkbookFactory.create(临时文件);
wb.close();

我与Apache的POI Maven的工作,3.9版

  close方法()是未定义的类型工作簿...线423 Java问题

注1:,为了正确地释放资源工作簿使用后应关闭。

注2:也从InputStream装车需要更多的内存比从文件加载

我想使用像这一 sayes


解决方案

  

找不到在Apache WorkbookFactory close()方法


您需要关闭工作簿,而不是它的工厂。


  

注1:,为了正确地释放资源工作簿应使用后关闭


正确的。


  

注2:也是从那个加载一个的InputStream 需要比加载更多的内存文件


不真实的,除非的InputStream ByteArrayInputStream的

i read about Apache WorkbookFactory

the guide are saying to close workbook when done. "Workbook should be closed after use"

but i dont have a close method to close it.

how could it be closed ?

Workbook wb = WorkbookFactory.create(tempFile);
wb.close();

i'm working with Apache poi Maven, version 3.9

The method close() is undefined for the type Workbook   ...     line 423    Java Problem

Note 1: that in order to properly release resources the Workbook should be closed after use.

Note 2: also that loading from an InputStream requires more memory than loading from a File

i would like to use a file and not an input stream like this one sayes

解决方案

cant find close() method on Apache WorkbookFactory

You need to close the Workbook, not its factory.

Note 1: that in order to properly release resources the Workbook should be closed after use.

Correct.

Note 2: also that loading from an InputStream requires more memory than loading from a File

Untrue, unless the InputStream is a ByteArrayInputStream.

这篇关于无法找到在Apache WorkbookFactory close()方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆