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

Unified Diff: runtime/bin/output_stream.dart

Issue 8493002: Change the default for the len argument to writeFrom on OutputStream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ Created 9 years, 1 month 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/file_impl.dart ('k') | runtime/bin/socket_stream.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/output_stream.dart
diff --git a/runtime/bin/output_stream.dart b/runtime/bin/output_stream.dart
index 8b834921aa6bd824d9c6572ca8d768a47959fc09..cee3b5061e2854b050cde17ccc91f89e2e674cac 100644
--- a/runtime/bin/output_stream.dart
+++ b/runtime/bin/output_stream.dart
@@ -17,24 +17,28 @@
*/
interface OutputStream {
/**
- * Writes the content of [buffer] to the stream. This will pass
- * ownership of the specified buffer to the system and the caller
- * should not change it. Returns true if the data could be written
- * to the underlying communication channel immediately. Otherwise
- * the data is buffered by the output stream and will be sent as
- * soon as possible.
+ * Writes the content of [buffer] to the stream. If [copyBuffer] is
+ * true ownership of the specified buffer is passed to the system
+ * and the caller should not change it afterwards. The default value
+ * for [copyBuffer] is true.
+ *
+ * Returns true if the data could be written to the underlying
+ * communication channel immediately. Otherwise the data is buffered
+ * by the output stream and will be sent as soon as possible.
*/
- bool write(List<int> buffer);
+ bool write(List<int> buffer, [bool copyBuffer]);
/**
* Writes [len] bytes from buffer [buffer] starting at offset
* [offset] to the output stream. If [offset] is not specified the
* default is 0. If [len] is not specified the default is the length
- * of the buffer passed. The system will copy the data to be written
- * so the caller can safely change [buffer] afterwards. Returns true
- * if the data could be written to the underlying communication
- * channel immediately. Otherwise the data is buffered by the output
- * stream and will be sent as soon as possible.
+ * of the buffer minus [offset] (i.e. writing from offset to the end
+ * of the buffer). The system will copy the data to be written so
+ * the caller can safely change [buffer] afterwards.
+ *
+ * Returns true if the data could be written to the underlying
+ * communication channel immediately. Otherwise the data is buffered
+ * by the output stream and will be sent as soon as possible.
*/
bool writeFrom(List<int> buffer, [int offset, int len]);
« no previous file with comments | « runtime/bin/file_impl.dart ('k') | runtime/bin/socket_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698