Java Stream Operation longArray(Stream stream)

Here you can find the source of longArray(Stream stream)

Description

Returns an array view of a Stream of Long

License

Open Source License

Parameter

Parameter Description
stream the Stream of Long to convert to an array

Return

an array view

Declaration

public static long[] longArray(Stream<Long> stream) 

Method Source Code

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

import java.util.stream.Stream;

public class Main {
    /**/*w  w  w .  ja v  a2 s .co m*/
     * Returns an array view of a Stream of Long
     *
     * @param stream the Stream of Long to convert to an array
     * @return an array view
     */
    public static long[] longArray(Stream<Long> stream) {
        return stream.mapToLong(Long::valueOf).toArray();
    }
}

Related

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