https://bz.apache.org/bugzilla/show_bug.cgi?id=59893
Bug ID: 59893
Summary: Forbid calls to InputStream.available
Product: POI
Version: 3.15-dev
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: POI Overall
Assignee: [email protected]
Reporter: [email protected]
Created attachment 34067
--> https://bz.apache.org/bugzilla/attachment.cgi?id=34067&action=edit
replace available() calls and add forbidden-apis-check
In #59841 I've realized a lot of wrong calls to InputStream.available().
The wrong assumption is, that it returns the bytes until the EOF, whereas it
really return the bytes until the next blocking read [1]
So when working with streams, you really need to read until EOF and not rely on
available().
This patch removes most of the calls to available() or ignores them for
delegates.
[1]
http://stackoverflow.com/questions/3695372/what-does-inputstream-available-do-in-java
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]