Java Stream Operation longList(LongStream stream)

Here you can find the source of longList(LongStream stream)

Description

Returns a List view of a LongStream

License

Open Source License

Parameter

Parameter Description
stream the LongStream to convert to a List

Return

a List view

Declaration

public static List<Long> longList(LongStream stream) 

Method Source Code

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

import java.util.List;

import java.util.stream.LongStream;

import static java.util.stream.Collectors.toList;

public class Main {
    /**/* w  ww.j a va 2 s.  c o  m*/
     * Returns a List view of a LongStream
     *
     * @param stream the LongStream to convert to a List
     * @return a List view
     */
    public static List<Long> longList(LongStream stream) {
        return stream.mapToObj(Long::valueOf).collect(toList());
    }
}

Related

  1. iteratorToFiniteStream(Iterator iterator, boolean parallel)
  2. iteratorToStream(final Iterator iterator)
  3. lazyPartition(final Stream stream, final int maxPartitionSize)
  4. lazyStream(PrimitiveIterator.OfLong iterator)
  5. longArray(Stream stream)
  6. makeStream(final Object[] array)
  7. mapElementsSizes(IntStream intStream)
  8. maximum(final Stream stream)
  9. maxLong(Stream stream)