add stream test to csv test case 497 #541
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#497 issue only seems to happen with byte array input - work ok with InputStream input.
When byte array input to UTF8Reader, the _inputSource is always null and the _ioContext is null which is what is checked in
canModifyBuffer()
. Is there any way that this code can be adjusted to work for byte array input - or should we take the byte array and wrap as ByteArrayInputStream? - which would also fix the broken test.The code that causes the issue.
jackson-dataformats-text/csv/src/main/java/com/fasterxml/jackson/dataformat/csv/impl/UTF8Reader.java
Lines 406 to 418 in 9a38ea2
Needed for a fuzz test to work but also breaks the 497 test.