transform<S> method
Applies a StreamTransformer to the current stream.
Returns the result of the stream transformation,
that is, the result of streamTransformer.bind(this)
.
This method simply allows writing the call to streamTransformer.bind
in a chained fashion, like
stream.map(mapping).transform(transformation).toList()
which can be more convenient than calling bind
directly.
The streamTransformer
can return any stream.
Whether the returned stream is a broadcast stream or not,
and which elements it will contain,
is entirely up to the transformation.
Implementation
Stream<S> transform<S>(StreamTransformer<T, S> streamTransformer) {
return streamTransformer.bind(this);
}