[
https://issues.apache.org/jira/browse/NIFI-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Joe Skora updated NIFI-715:
---------------------------
Attachment: nifi-715.patch
Patch attached for [NIFI-715|https://issues.apache.org/jira/browse/NIFI-715]
bytes available issue in InputStreamCallback. Fixed LimitedInputStream class
which did not reflect limit in available(). Limit handling was corrected or
added to available(), mark(), and reset() methods. Test class renamed
TestLimitedOutputStream to TestLimitedInputStream and tests updated to cover
original issue and updates.
> InputStreamCallback InputStream reporting more bytes available than actually
> readable
> -------------------------------------------------------------------------------------
>
> Key: NIFI-715
> URL: https://issues.apache.org/jira/browse/NIFI-715
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 0.1.0
> Environment: OS X, Windows, Linux
> Reporter: Adam Moreland
> Priority: Minor
> Attachments: nifi-715.patch
>
>
> When reading off of the InputStream within an InputStreamCallback, the
> InputStream appears to report the bytes available in the content claim from
> the start of the current flowFile through the end of the content claim.
> As a basic test, I ran three files (sizes 38 bytes, 93 bytes, and 20 bytes)
> through a GetFile processor followed by a basic processor that reads the
> flowFile and outputs the in.available() value, reads until it comes to the
> end of the file and outputs the number of bytes read. The output is as
> follows:
> 2015-06-22 20:23:19,447 INFO [Timer-Driven Process Thread-10]
> test.testprocessor.TestProcessor
> TestProcessor[id=386616eb-5ebc-4da9-8365-3b32fc539407] Bytes available: 151
> 2015-06-22 20:23:19,447 INFO [Timer-Driven Process Thread-10]
> test.testprocessor.TestProcessor
> TestProcessor[id=386616eb-5ebc-4da9-8365-3b32fc539407] Bytes read: 38
> 2015-06-22 20:23:19,448 INFO [Timer-Driven Process Thread-8]
> test.testprocessor.TestProcessor
> TestProcessor[id=386616eb-5ebc-4da9-8365-3b32fc539407] Bytes available: 113
> 2015-06-22 20:23:19,449 INFO [Timer-Driven Process Thread-8]
> test.testprocessor.TestProcessor
> TestProcessor[id=386616eb-5ebc-4da9-8365-3b32fc539407] Bytes read: 93
> 2015-06-22 20:23:19,449 INFO [Timer-Driven Process Thread-8]
> test.testprocessor.TestProcessor
> TestProcessor[id=386616eb-5ebc-4da9-8365-3b32fc539407] Bytes available: 20
> 2015-06-22 20:23:19,449 INFO [Timer-Driven Process Thread-8]
> test.testprocessor.TestProcessor
> TestProcessor[id=386616eb-5ebc-4da9-8365-3b32fc539407] Bytes read: 20
> Also affects the InputStream within a StreamCallback.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)