@Override public boolean tryAdvance(IntConsumer action) { if (action == null) throw new NullPointerException(); if (index >= 0 && index < limit) { action.accept(buffer.getUnchecked(index++)); return true; } return false; }
@Override public void forEachRemaining(IntConsumer action) { if (action == null) throw new NullPointerException(); CharBuffer cb = buffer; int i = index; int hi = limit; index = hi; while (i < hi) { action.accept(cb.getUnchecked(i++)); } }