Brandon DeVries created NIFI-4856:

             Summary: ByteCountingInputStream should override available()
                 Key: NIFI-4856
             Project: Apache NiFi
          Issue Type: Bug
    Affects Versions: 1.5.0
            Reporter: Brandon DeVries

ByteCountingInputStream [1] does not override the InputStream.available() 
method as indicated in the InputStream javadocs [2].  In 0.x[3] there was 
another implementation of ByteCountingInputStream  that correctly overrode 
available().  However, this was replaced with the incorrect version in 1.x. 


This causes any processor that attempts to use the available() method of the 
InputStream returned from to erroneously believe it has 
reached the end of the stream, as this method is supposed to return "an 
estimate of the number of bytes that can be read (or skipped over) from this 
input stream without blocking *or {{0}} when it reaches the end* of the input 


The following method needs to be added:

public int available() throws IOException {

     return in.available();



[2] []




This message was sent by Atlassian JIRA

Reply via email to