We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dc1b0e5 + c695c86 commit 1b67b5eCopy full SHA for 1b67b5e
msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java
@@ -263,6 +263,12 @@ private static int utf8MultibyteCharacterSize(byte firstByte)
263
*/
264
public boolean hasNext()
265
throws IOException
266
+ {
267
+ return ensureBuffer();
268
+ }
269
+
270
+ private boolean ensureBuffer()
271
+ throws IOException
272
{
273
while (buffer.size() <= position) {
274
MessageBuffer next = in.next();
@@ -290,7 +296,7 @@ public MessageFormat getNextFormat()
290
296
291
297
292
298
// makes sure that buffer has at leat 1 byte
293
- if (!hasNext()) {
299
+ if (!ensureBuffer()) {
294
300
throw new MessageInsufficientBufferException();
295
301
}
302
byte b = buffer.getByte(position);
0 commit comments