Future pipe(
StreamConsumer<RawSocketEvent> streamConsumer
)

Binds this stream as the input of the provided StreamConsumer.

The streamConsumer is closed when the stream has been added to it.

Returns a future which completes when the stream has been consumed and the consumer has been closed.

Source

/**
 * Binds this stream as the input of the provided [StreamConsumer].
 *
 * The `streamConsumer` is closed when the stream has been added to it.
 *
 * Returns a future which completes when the stream has been consumed
 * and the consumer has been closed.
 */
Future pipe(StreamConsumer<T> streamConsumer) {
  return streamConsumer.addStream(this).then((_) => streamConsumer.close());
}