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

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

Issue 11336012: Remove public SocketInputStream and SocketOutputStream clases (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/socket_stream.dart ('k') | tests/standalone/io/echo_server_stream_test.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 InputStream {
6 _SocketInputStream(Socket socket) : _socket = socket { 6 _SocketInputStream(Socket socket) : _socket = socket {
7 if (_socket._closed) _closed = true; 7 if (_socket._closed) _closed = true;
8 _socket.onClosed = _onClosed; 8 _socket.onClosed = _onClosed;
9 } 9 }
10 10
11 List<int> read([int len]) { 11 List<int> read([int len]) {
12 int bytesToRead = available(); 12 int bytesToRead = available();
13 if (bytesToRead == 0) return null; 13 if (bytesToRead == 0) return null;
14 if (len !== null) { 14 if (len !== null) {
15 if (len <= 0) { 15 if (len <= 0) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 89
90 Socket _socket; 90 Socket _socket;
91 bool _closed = false; 91 bool _closed = false;
92 Function _clientCloseHandler; 92 Function _clientCloseHandler;
93 Function _onError; 93 Function _onError;
94 } 94 }
95 95
96 96
97 class _SocketOutputStream 97 class _SocketOutputStream
98 extends _BaseOutputStream implements SocketOutputStream { 98 extends _BaseOutputStream implements OutputStream {
99 _SocketOutputStream(Socket socket) 99 _SocketOutputStream(Socket socket)
100 : _socket = socket, _pendingWrites = new _BufferList(); 100 : _socket = socket, _pendingWrites = new _BufferList();
101 101
102 bool write(List<int> buffer, [bool copyBuffer = true]) { 102 bool write(List<int> buffer, [bool copyBuffer = true]) {
103 return _write(buffer, 0, buffer.length, copyBuffer); 103 return _write(buffer, 0, buffer.length, copyBuffer);
104 } 104 }
105 105
106 bool writeFrom(List<int> buffer, [int offset = 0, int len]) { 106 bool writeFrom(List<int> buffer, [int offset = 0, int len]) {
107 return _write( 107 return _write(
108 buffer, offset, (len == null) ? buffer.length - offset : len, true); 108 buffer, offset, (len == null) ? buffer.length - offset : len, true);
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 221 }
222 } 222 }
223 223
224 Socket _socket; 224 Socket _socket;
225 _BufferList _pendingWrites; 225 _BufferList _pendingWrites;
226 Function _onNoPendingWrites; 226 Function _onNoPendingWrites;
227 Function _onClosed; 227 Function _onClosed;
228 bool _closing = false; 228 bool _closing = false;
229 bool _closed = false; 229 bool _closed = false;
230 } 230 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_stream.dart ('k') | tests/standalone/io/echo_server_stream_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698