Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2583)

Unified Diff: sdk/lib/core/sink.dart

Issue 203603008: Introduce class Sink<T>. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/core/corelib_sources.gypi ('k') | sdk/lib/io/data_transformer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/sink.dart
diff --git a/sdk/lib/core/sink.dart b/sdk/lib/core/sink.dart
new file mode 100644
index 0000000000000000000000000000000000000000..0d8f2eff254a9528e114c2d0d083265b617b0f52
--- /dev/null
+++ b/sdk/lib/core/sink.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2014, 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.
+
+part of dart.core;
+
+/**
+ * A generic destination for data.
+ *
+ * Multiple data values can be put into a sink, and when no more data is
+ * available, the sink should be closed.
+ *
+ * This is a generic interface that other data receivers can implement.
+ */
+abstract class Sink<T> {
+ /**
+ * Put the data into the sink.
+ *
+ * Must not be called after a call to [close].
+ */
+ void add(T data);
+
+ /**
+ * Tell the sink that no further data will be added.
+ *
+ * Calling this method more than once is allowed, but does nothing.
+ *
+ * The [add] method must not be called after this method.
+ */
+ void close();
+}
« no previous file with comments | « sdk/lib/core/corelib_sources.gypi ('k') | sdk/lib/io/data_transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698