OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library streamed_request; | 5 library streamed_request; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:uri'; | 9 import 'dart:uri'; |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 /// Creates a new streaming request. | 33 /// Creates a new streaming request. |
34 StreamedRequest(String method, Uri url) | 34 StreamedRequest(String method, Uri url) |
35 : super(method, url), | 35 : super(method, url), |
36 _controller = new StreamController<List<int>>(); | 36 _controller = new StreamController<List<int>>(); |
37 | 37 |
38 /// Freezes all mutable fields other than [stream] and returns a | 38 /// Freezes all mutable fields other than [stream] and returns a |
39 /// single-subscription [ByteStream] that emits the data being written to | 39 /// single-subscription [ByteStream] that emits the data being written to |
40 /// [sink]. | 40 /// [sink]. |
41 ByteStream finalize() { | 41 ByteStream finalize() { |
42 super.finalize(); | 42 super.finalize(); |
43 return new ByteStream(_controller); | 43 return new ByteStream(_controller.stream); |
44 } | 44 } |
45 } | 45 } |
OLD | NEW |