Arrays.stream() vs Stream.of()

Brian Goetz brian.goetz at oracle.com
Thu Aug 22 06:07:36 PDT 2013


Slight correction: it is Stream.of() that duplicates Arrays.stream() 
functionality for arrays :)

It is fine to use either.  Stream.of() is implemented in terms of 
Arrays.stream; Arrays.stream also has methods that make a stream out of 
an array slice.

On 8/22/2013 5:33 AM, Richard Warburton wrote:
> Hi,
>
> There are a series of Arrays.stream() methods which offer duplicate
> functionality to the Stream.of(), IntStream.of() etc methods.  I appreciate
> there's a slight difference in that one takes arrays directly, and the
> other varargs but I'm pretty sure that enough people realise that you can
> pass arrays into varargs methods to not warrant the duplication.
>
> regards,
>
>    Dr. Richard Warburton
>
>    http://insightfullogic.com
>    @RichardWarburto <http://twitter.com/richardwarburto>
>


More information about the lambda-dev mailing list