| 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; | |
| 6 | |
| 7 import 'dart:async'; | 5 import 'dart:async'; |
| 8 | 6 |
| 9 import 'byte_stream.dart'; | 7 import 'byte_stream.dart'; |
| 10 import 'base_request.dart'; | 8 import 'base_request.dart'; |
| 11 | 9 |
| 12 /// An HTTP request where the request body is sent asynchronously after the | 10 /// An HTTP request where the request body is sent asynchronously after the |
| 13 /// connection has been established and the headers have been sent. | 11 /// connection has been established and the headers have been sent. |
| 14 /// | 12 /// |
| 15 /// When the request is sent via [BaseClient.send], only the headers and | 13 /// When the request is sent via [BaseClient.send], only the headers and |
| 16 /// whatever data has already been written to [StreamedRequest.stream] will be | 14 /// whatever data has already been written to [StreamedRequest.stream] will be |
| (...skipping 17 matching lines...) Expand all Loading... |
| 34 _controller = new StreamController<List<int>>(sync: true); | 32 _controller = new StreamController<List<int>>(sync: true); |
| 35 | 33 |
| 36 /// Freezes all mutable fields other than [stream] and returns a | 34 /// Freezes all mutable fields other than [stream] and returns a |
| 37 /// single-subscription [ByteStream] that emits the data being written to | 35 /// single-subscription [ByteStream] that emits the data being written to |
| 38 /// [sink]. | 36 /// [sink]. |
| 39 ByteStream finalize() { | 37 ByteStream finalize() { |
| 40 super.finalize(); | 38 super.finalize(); |
| 41 return new ByteStream(_controller.stream); | 39 return new ByteStream(_controller.stream); |
| 42 } | 40 } |
| 43 } | 41 } |
| OLD | NEW |