Questions about Stream/Iterable/Files - and possibly the compiler

Paul Sandoz paul.sandoz at
Fri Nov 6 08:36:03 UTC 2015

> On 5 Nov 2015, at 23:05, Remi Forax <forax at> wrote:
>> At last, question B: Given all those premises, is there a specific reason
>> for which Files.write() hasn't been overloaded with a version capable of
>> accepting a Stream<String>?

No particular reason, just never got around to thinking about it. Seems like reasonable thing to do.

I logged an issue: <>

>> It would have been the perfect complement of
>> Files.lines()
> adding overloads with different interfaces is not a good idea, you can have a class that implements both interfaces (Stream and Iterable).

Ordinarily i would agree with you, but in this case a class that implements Stream and Iterable is arguably a very confused class indeed (much like a class that implements Iterable and Iterator).


More information about the core-libs-dev mailing list