Skip to content

Handle short reads and truncated binary input - #57

Open
sylvesterkaczmarek wants to merge 1 commit into
esa:masterfrom
sylvesterkaczmarek:fix/binary-decoder-short-reads
Open

sylvesterkaczmarek wants to merge 1 commit into
esa:masterfrom
sylvesterkaczmarek:fix/binary-decoder-short-reads

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #56.

Keep filling the input buffer until the requested bytes are available. Reject exhausted streams, reads without progress and truncated array buffers with MALException instead of decoding unfilled or stale bytes.

Add 11 regressions covering fixed/variable decoding, fragmented strings and byte blocks, buffer compaction, split-binary bit-store preservation, truncation and I/O failures.

Validation: mvn -B -ntp -f encodings/encoding-binary/pom.xml clean test passed all 11 tests. Seven of the initial eight regression tests failed before the fix. The full reactor was not run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Binary decoder returns incorrect data after short stream reads

1 participant