OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library test.util.delegating_sink; |
| 6 |
| 7 // TODO(nweiz): Move this into package:async. |
| 8 /// An implementation of [Sink] that forwards all calls to a wrapped [Sink]. |
| 9 /// |
| 10 /// This can also be used on a subclass to make it look like a normal [Sink]. |
| 11 class DelegatingSink<T> implements Sink<T> { |
| 12 /// The wrapped [Sink]. |
| 13 final Sink _inner; |
| 14 |
| 15 DelegatingSink(this._inner); |
| 16 |
| 17 void add(T data) { |
| 18 _inner.add(data); |
| 19 } |
| 20 |
| 21 void close() { |
| 22 _inner.close(); |
| 23 } |
| 24 } |
OLD | NEW |