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

Side by Side Diff: tests/standalone/io/process_stdin_transform_unsubscribe_script.dart

Issue 22872012: Remove Encoding-enum from dart:io and add interface in dart:convert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix ddbg. Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // Utility script to echo stdin to stdout or stderr or both. 5 // Utility script to echo stdin to stdout or stderr or both.
6 6
7 import "dart:convert"; 7 import "dart:convert";
8 import "dart:io"; 8 import "dart:io";
9 9
10 main() { 10 main() {
11 var subscription; 11 var subscription;
12 subscription = stdin 12 subscription = stdin
13 .transform(new StringDecoder()) 13 .transform(UTF8.decoder)
14 .transform(new LineSplitter()) 14 .transform(new LineSplitter())
15 .listen((String line) { 15 .listen((String line) {
16 // Unsubscribe after the first line. 16 // Unsubscribe after the first line.
17 subscription.cancel(); 17 subscription.cancel();
18 }); 18 });
19 } 19 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698