[
https://issues.apache.org/jira/browse/CAMEL-9745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15206784#comment-15206784
]
Sverker Abrahamsson commented on CAMEL-9745:
--------------------------------------------
For TarIterator I wrote a suggestion for a solution, but it depends on knowing
the size of the file being spitted up and keeping track of how much is
consumed. However, that is not always the case as the input may just be an
input stream (originally in the tar case from a tape drive) so it falls back to
the old logic so that case must be handled anyway. It might be preferable to
just do as you suggest and skip if null is returned from next(), hence no need
to keep track of the length of the data to be splitted.
> Splitter - Should skip null messages if iterator returns null
> -------------------------------------------------------------
>
> Key: CAMEL-9745
> URL: https://issues.apache.org/jira/browse/CAMEL-9745
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.16.2
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Fix For: 2.16.3, 2.18.0, 2.17.1
>
>
> When splitting and using an iterator the usually hasNext -> next is paired so
> if hasNext returns true, then next returns data. But there can be situations
> where this is tricky to determine up front, and therefore a hasNext may
> return true, and then next() return null if there was no data really. Then
> the splitter should just skip that null and continue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)