resetDecoder should be called once per decoding by miniway · Pull Request #387 · msgpack/msgpack-java

@miniway

When multiple MessageBuffer involved at unpackString first bytes can be removed because resetDecoder is called multiple times.

xerial

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.

@miniway

xerial

}

"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.

xerial added a commit that referenced this pull request

Sep 23, 2016

@xerial

@xerial

frsyuki

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.