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

Unified Diff: lib/io/socket.dart

Issue 11338037: Start reading data from sockets directly into external byte arrays (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ Created 8 years, 2 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 | « no previous file | lib/io/socket_stream_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/io/socket.dart
diff --git a/lib/io/socket.dart b/lib/io/socket.dart
index 097b8dd2c4a2dc45506275f25b7efe3e9dbf9cec..19fc0eb9c1ba6b85e2033541a694cded4819fcf3 100644
--- a/lib/io/socket.dart
+++ b/lib/io/socket.dart
@@ -47,6 +47,15 @@ abstract class Socket {
int available();
/**
+ * Read up to [len] bytes from the socket. This function is
+ * non-blocking and will only return data if data is available. The
+ * number of bytes read can be less then [len] if fewer bytes are
+ * available for immediate reading. If no data is available [null]
+ * is returned.
+ */
+ List<int> read([int len]);
+
+ /**
* Reads up to [count] bytes of data from the socket and stores them into
* buffer after buffer offset [offset]. The number of successfully read
* bytes is returned. This function is non-blocking and will only read data
« no previous file with comments | « no previous file | lib/io/socket_stream_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698