transform<S> method

Stream<S> transform <S>(StreamTransformer<T, S> streamTransformer)

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

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.


Stream<S> transform<S>(StreamTransformer<T, S> streamTransformer) {
  return streamTransformer.bind(this);