CloseableStream exceptions [was: Re: experience trying out lambda-8-b74]

Olexandr Demura oleksander.demura at
Tue Feb 5 06:47:10 PST 2013

Isn't ConsumerEx imply existence of StreamEx &Co. so we do not need any
where `StreamEx<T, Ex>` extends `BaseStream<T>`
and `ConsumerEx<T, Ex> { void accept(T o) throws Ex }` is not related to
just like with primitives - other essential and dominant java feature.

Then void `close() throws Exception` is natural, leading to `Closeable`

2013/2/5 Zhong Yu <zhong.j.yu at>

> Say we cannot do
>     Consumer<Path> deleteAction = Files::delete;
> since Files.delete() throws IOException. But a generic wrapper would do
>     Consumer<Path> deleteAction = wrap(Files::delete);
>     static <T> Consumer<T> wrap(ConsumerEx<T>){..}
>     // ... and wrap() for other functional interfaces
> Zhong Yu

More information about the lambda-dev mailing list