{"action":"created","issue":{"url":"https://api.github.com/repos/centic9/poi-on-android/issues/17","repository_url":"https://api.github.com/repos/centic9/poi-on-android","labels_url":"https://api.github.com/repos/centic9/poi-on-android/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/centic9/poi-on-android/issues/17/comments","events_url":"https://api.github.com/repos/centic9/poi-on-android/issues/17/events","html_url":"https://github.com/centic9/poi-on-android/issues/17","id":245619403,"number":17,"title":"WorkbookFactory don't work","user":{"login":"Faltfromoss","id":18700275,"avatar_url":"https://avatars2.githubusercontent.com/u/18700275?v=4","gravatar_id":"","url":"https://api.github.com/users/Faltfromoss","html_url":"https://github.com/Faltfromoss","followers_url":"https://api.github.com/users/Faltfromoss/followers","following_url":"https://api.github.com/users/Faltfromoss/following{/other_user}","gists_url":"https://api.github.com/users/Faltfromoss/gists{/gist_id}","starred_url":"https://api.github.com/users/Faltfromoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faltfromoss/subscriptions","organizations_url":"https://api.github.com/users/Faltfromoss/orgs","repos_url":"https://api.github.com/users/Faltfromoss/repos","events_url":"https://api.github.com/users/Faltfromoss/events{/privacy}","received_events_url":"https://api.github.com/users/Faltfromoss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-07-26T06:32:20Z","updated_at":"2018-03-17T21:04:55Z","closed_at":null,"author_association":"NONE","body":"I tried to open a file that I need to edit with the InputStream. The file size is ~1mb. \r\n```\r\nFile file = getExternalPath();   // here I get target file    \r\n        if(!file.exists()){\r\n            messageTextView.setText(\"File not found\");\r\n            return;\r\n        }\r\n        try (InputStream inp = new FileInputStream(file))\r\n         {\r\n            Workbook wb = WorkbookFactory.create(inp);\r\n            messageTextView.setText(String.valueOf(wb.getNumberOfSheets()));\r\n        } catch (IOException ex) {\r\n            messageTextView.setText(ex.getMessage());\r\n       }\r\n```\r\nAnd it works, but the function `wb.getNumberOfSheets()`  is processed 30-50 seconds! That is, the application for this time just hangs. And in general, whenever you turn to the book, there is such a hang. However, if you refer to an empty excel file, the function executes instantly. The [documentation \"Apache poi\"](https://poi.apache.org/spreadsheet/quick-guide.html#FileInputStream) states that the use of InputStream requires more memory than using the file. I tried to connect to the book using a File.\r\n\r\n`Workbook wb = WorkbookFactory.create(file);`\r\n\r\nBut thus I receive exception:\r\n\r\n`org.apache.poi.openxml4j.util.ZipSecureFile$ThresholdInputStream cannot be cast to java.util.zip.ZipFile$RAFStream`\r\n\r\nI can not understand what the problem is again :/"},"comment":{"url":"https://api.github.com/repos/centic9/poi-on-android/issues/comments/373952542","html_url":"https://github.com/centic9/poi-on-android/issues/17#issuecomment-373952542","issue_url":"https://api.github.com/repos/centic9/poi-on-android/issues/17","id":373952542,"user":{"login":"centic9","id":548322,"avatar_url":"https://avatars0.githubusercontent.com/u/548322?v=4","gravatar_id":"","url":"https://api.github.com/users/centic9","html_url":"https://github.com/centic9","followers_url":"https://api.github.com/users/centic9/followers","following_url":"https://api.github.com/users/centic9/following{/other_user}","gists_url":"https://api.github.com/users/centic9/gists{/gist_id}","starred_url":"https://api.github.com/users/centic9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/centic9/subscriptions","organizations_url":"https://api.github.com/users/centic9/orgs","repos_url":"https://api.github.com/users/centic9/repos","events_url":"https://api.github.com/users/centic9/events{/privacy}","received_events_url":"https://api.github.com/users/centic9/received_events","type":"User","site_admin":false},"created_at":"2018-03-17T21:04:55Z","updated_at":"2018-03-17T21:04:55Z","author_association":"OWNER","body":"Please note that a similar problem as `org.apache.poi.openxml4j.util.ZipSecureFile$ThresholdInputStream cannot be cast to java.util.zip.ZipFile$RAFStream` also occurs in non-Android usage of Apache POI with current Java 10 release candidates. \r\n\r\nIt seems this will need a fix in Apache POI itself and there is likely not much that I can do here. See https://bz.apache.org/bugzilla/show_bug.cgi?id=62187 for the discussion/state of this in Apache POI."}}
{"actor":{"display_login":"centic9"}}