Is calling foreach on a BufferedIterator not optimized?