resetDecoder should be called once per decoding by miniway · Pull Request #387 · msgpack/msgpack-java
When multiple MessageBuffer involved at unpackString first bytes can be removed because resetDecoder is called multiple times.
| this.sequence = checkNotNull(sequence, "input sequence is null"); | ||
| try { | ||
| nextInput(); | ||
| } catch (IOException ignore) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| "read numeric data at buffer boundary" taggedAs("boundary2") in { | ||
| "read data at buffer boundary" taggedAs("boundary2") in { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case is intended for checking a bug on unpackInteger that found in the past. We should have another test case for string.
| private Enumeration<? extends MessageBufferInput> sequence; | ||
| private MessageBufferInput input; | ||
|
|
||
| public SequenceMessageBufferInput(Enumeration<? extends MessageBufferInput> sequence) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use Iterator, Stream, Iterable, or Collection instead of Enumeration? or how about moving this to test package only for now? Because Enumeration is considered as a deprecated interface used only by old classes such as Vector or Hashtable.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Iterator<MessageBufferInput> would work. And this should be in test package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters