GitHub user ataylor284 opened a pull request: https://github.com/apache/groovy/pull/247
Added new class BufferedIterator. BufferedIterator is a wrapper for Iterator that adds a new method `head` to return the next item without consuming it. A helper method was also added to DefaultGroovyMethods to create a buffered wrapper by calling iterator.buffered() on any Iterator. BufferedIterator is loosely based on the Scala class of the same name. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ataylor284/groovy feature/buffered-iterator Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/247.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #247 ---- commit 2c4c03af8729ba1b51dbf5c7ff7fa5ac9f6c7633 Author: Andrew Taylor <atay...@redtoad.ca> Date: 2016-01-24T07:45:52Z Added BufferedIterator. BufferedIterator is a wrapper for Iterator that adds a new method `head` to return the next item without consuming it. A helper method was also added to DefaultGroovyMethods to create a buffered wrapper by calling iterator.buffered() on any Iterator. BufferedIterator is loosely based on the Scala class of the same name. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---