poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 59893] New: Forbid calls to InputStream.available
Date Sat, 23 Jul 2016 12:11:41 GMT
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: dev@poi.apache.org
          Reporter: kiwiwings@apache.org

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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message