Java Stream of stream(Enumeration enumeration)

Here you can find the source of stream(Enumeration enumeration)

Description

stream

License

Apache License

Declaration

public static <T> Stream<T> stream(Enumeration<T> enumeration) 

Method Source Code


//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);
    }/* w  w  w  .j  av a2  s .c om*/

    public static <T> Stream<T> stream(Iterator<T> iterator) {
        Iterable<T> iterable = () -> iterator;
        return StreamSupport.stream(iterable.spliterator(), false);
    }
}

Related

  1. stream(Class clazz)
  2. stream(Collection collection)
  3. stream(final Iterator iterator)
  4. stream(Iterable iterable)
  5. stream(Iterable input)
  6. stream(Iterable iterable)