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

Unified Diff: tests/standalone/io/stream_buffer_test.dart

Issue 10836177: Add StreamBuffer to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase, without changes. Created 8 years, 4 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 | « runtime/bin/stream_buffer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/stream_buffer_test.dart
diff --git a/tests/standalone/io/stream_buffer_test.dart b/tests/standalone/io/stream_buffer_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..7dacfec3311ba2262b1428d3fb25d192532b2249
--- /dev/null
+++ b/tests/standalone/io/stream_buffer_test.dart
@@ -0,0 +1,28 @@
+#import("dart:io");
+#import("dart:isolate");
+#import("dart:math");
+
+#source("stream_buffer.dart");
+
+void main() {
+ var buffer = new StreamBuffer();
+ var out = buffer.toBuffer;
+ var een = buffer.fromBuffer;
+ een.onData = () {
+ var first = new List<int>(6);
+ een.readInto(first, 1, 4);
+ print(first);
+ een.onData = () {
+ var data = een.read(2);
+ print(data);
+ };
+ };
+ een.onClosed = () {
+ print('buffer closed');
+ };
+
+ out.write([23, 17, 19]);
+ out.write([27, 35]);
+ out.write([56, 98]);
+ out.close();
+}
« no previous file with comments | « runtime/bin/stream_buffer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698