| Index: mojo/public/dart/third_party/async/lib/src/delegate/stream_consumer.dart
|
| diff --git a/mojo/public/dart/third_party/async/lib/src/delegate/stream_consumer.dart b/mojo/public/dart/third_party/async/lib/src/delegate/stream_consumer.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8162db6d8ec7886befc3902e664de3d2170453d4
|
| --- /dev/null
|
| +++ b/mojo/public/dart/third_party/async/lib/src/delegate/stream_consumer.dart
|
| @@ -0,0 +1,23 @@
|
| +// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +library async.delegate.stream_consumer;
|
| +
|
| +import 'dart:async';
|
| +
|
| +/// Simple delegating wrapper around a [StreamConsumer].
|
| +///
|
| +/// Subclasses can override individual methods, or use this to expose only the
|
| +/// [StreamConsumer] methods of a subclass.
|
| +class DelegatingStreamConsumer<T> implements StreamConsumer<T> {
|
| + final StreamConsumer _consumer;
|
| +
|
| + /// Create a delegating consumer forwarding calls to [consumer].
|
| + DelegatingStreamConsumer(StreamConsumer consumer)
|
| + : _consumer = consumer;
|
| +
|
| + Future addStream(Stream<T> stream) => _consumer.addStream(stream);
|
| +
|
| + Future close() => _consumer.close();
|
| +}
|
|
|