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

Side by Side Diff: runtime/bin/socket_stream_impl.dart

Issue 9653026: Add writeString method to OutputStream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 years, 9 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
« no previous file with comments | « runtime/bin/output_stream.dart ('k') | runtime/bin/stream_util.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 class _SocketInputStream implements SocketInputStream { 5 class _SocketInputStream implements SocketInputStream {
6 _SocketInputStream(Socket socket) : _socket = socket { 6 _SocketInputStream(Socket socket) : _socket = socket {
7 if (_socket._id == -1) _closed = true; 7 if (_socket._id == -1) _closed = true;
8 _socket.onClosed = _onClosed; 8 _socket.onClosed = _onClosed;
9 } 9 }
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 _clientCloseHandler(); 76 _clientCloseHandler();
77 } 77 }
78 } 78 }
79 79
80 Socket _socket; 80 Socket _socket;
81 Function _clientCloseHandler; 81 Function _clientCloseHandler;
82 bool _closed = false; 82 bool _closed = false;
83 } 83 }
84 84
85 85
86 class _SocketOutputStream implements SocketOutputStream { 86 class _SocketOutputStream
87 extends _BaseOutputStream implements SocketOutputStream {
87 _SocketOutputStream(Socket socket) 88 _SocketOutputStream(Socket socket)
88 : _socket = socket, _pendingWrites = new _BufferList(); 89 : _socket = socket, _pendingWrites = new _BufferList();
89 90
90 bool write(List<int> buffer, [bool copyBuffer = true]) { 91 bool write(List<int> buffer, [bool copyBuffer = true]) {
91 return _write(buffer, 0, buffer.length, copyBuffer); 92 return _write(buffer, 0, buffer.length, copyBuffer);
92 } 93 }
93 94
94 bool writeFrom(List<int> buffer, [int offset = 0, int len]) { 95 bool writeFrom(List<int> buffer, [int offset = 0, int len]) {
95 return _write( 96 return _write(
96 buffer, offset, (len == null) ? buffer.length - offset : len, true); 97 buffer, offset, (len == null) ? buffer.length - offset : len, true);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 if (_streamErrorHandler != null) _streamErrorHandler(); 185 if (_streamErrorHandler != null) _streamErrorHandler();
185 } 186 }
186 187
187 Socket _socket; 188 Socket _socket;
188 _BufferList _pendingWrites; 189 _BufferList _pendingWrites;
189 var _onNoPendingWrites; 190 var _onNoPendingWrites;
190 var _streamErrorHandler; 191 var _streamErrorHandler;
191 bool _closing = false; 192 bool _closing = false;
192 bool _closed = false; 193 bool _closed = false;
193 } 194 }
OLDNEW
« no previous file with comments | « runtime/bin/output_stream.dart ('k') | runtime/bin/stream_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698