This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
A length method may consume all content of the iterator. Most probably, your particular implementation takes items from the iterator and just counts them. There is a note in the scaladoc for the length method:
Reuse: After calling this method, one should discard the iterator it was called on. Using it is undefined and subject to change.
This behaviour is exposed by many other methods (like sum, max, etc...). All that methods will consume content of the iterator. I believe it (undefined behaviour after some "aggregate" method) applies not only to Iterator, but to any instance of TraversableOnce (from which Iterator extends).
To fix you problem you should first store items in some collection (list will be fine because you need it later) and then use that collection.