Created
May 14, 2012 22:26
-
-
Save okram/2697842 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A CloseableIterable which wraps a simple iterator. | |
* | |
* @author Joshua Shinavier (http://fortytwo.net) | |
*/ | |
public class IteratorCloseableIterable<T> implements CloseableIterable<T> { | |
private final Iterator<T> iterator; | |
public IteratorCloseableIterable(Iterator<T> iterator) { | |
this.iterator = iterator; | |
} | |
@Override | |
public void close() { | |
// Do nothing. | |
} | |
@Override | |
public Iterator<T> iterator() { | |
return iterator; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment