Java Stream of stream(final Iterator iterator)

Here you can find the source of stream(final Iterator iterator)

Description

stream

License

Open Source License

Declaration

public static <T> Stream<T> stream(final Iterator<T> iterator) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

import java.util.stream.Stream;
import java.util.stream.StreamSupport;

public class Main {
    public static <T> Stream<T> stream(final Iterable<T> iterable) {
        return StreamSupport.stream(iterable.spliterator(), false);
    }/*from  ww  w.  j  ava2s  .  co  m*/

    public static <T> Stream<T> stream(final Iterator<T> iterator) {
        return stream(() -> iterator);
    }
}

Related

  1. stream(Class clazz)
  2. stream(Collection collection)
  3. stream(Enumeration enumeration)
  4. stream(Iterable iterable)
  5. stream(Iterable input)
  6. stream(Iterable iterable)
  7. stream(Iterable iterable)