htsjdk.samtools.util.Iterables Maven / Gradle / Ivy
package htsjdk.samtools.util;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* @author mccowan
*/
public class Iterables {
private Iterables() {
}
public static List slurp(final Iterator iterator) {
final List ts = new ArrayList();
while (iterator.hasNext()) ts.add(iterator.next());
return ts;
}
public static List slurp(final Iterable iterable) {
return slurp(iterable.iterator());
}
}