Arrays.stream() vs Stream.of()
Michael Hixson
michael.hixson at gmail.com
Thu Aug 22 03:11:25 PDT 2013
I'm assuming that you prefer the Stream.of methods. Are you proposing
that the Arrays.stream methods should be removed? One issue with that
is that there is both:
Arrays.stream(array)
Arrays.stream(array, start, end)
It would be unfortunate to lose that second form or to have it without
the first, since the other Arrays methods have both forms.
Then there are the Arrays.parallelStream methods. I'm guessing those
exist because Arrays.stream(array).parallel() is (maybe?) slightly
less efficient than Arrays.parallelStream(array), and the sort of
people who want to get down and dirty with arrays in the first place
are likely to care about that. Those methods seem more at home on a
low-level utility class like Arrays than an interface like Stream.
-Michael
On Thu, Aug 22, 2013 at 2:33 AM, Richard Warburton
<richard.warburton at gmail.com> 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