cast<S> method

  1. @override
StreamChannel<S> cast <S>()

Returns a copy of this with the generic type coerced to S.

If any events emitted by stream aren't of type S, they're converted into CastError events. Similarly, if any events are added to sink that aren't of type S, a CastError is thrown.


StreamChannel<S> cast<S>() => StreamChannel(
    DelegatingStream.typed(stream), DelegatingStreamSink.typed(sink));