java: Unpacker: rewind internal buffer on filled <= offset

This commit is contained in:
frsyuki 2010-05-30 01:39:48 +09:00
parent 6df86384ca
commit 81b0c316cd

View File

@ -288,6 +288,12 @@ public class Unpacker implements Iterable<Object> {
return; return;
} }
if(impl.filled <= impl.offset) {
// rewind the buffer
impl.filled = 0;
impl.offset = 0;
}
if(impl.buffer.length - impl.filled >= require) { if(impl.buffer.length - impl.filled >= require) {
return; return;
} }