Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Enumeration; import java.util.Iterator; import java.util.stream.Stream; import java.util.stream.StreamSupport; public class Main { public static <T> Stream<T> stream(Enumeration<T> enumeration) { return stream(enumeration); } public static <T> Stream<T> stream(Iterator<T> iterator) { Iterable<T> iterable = () -> iterator; return StreamSupport.stream(iterable.spliterator(), false); } }