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

Side by Side Diff: runtime/bin/list_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/input_stream.dart ('k') | runtime/bin/output_stream.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 /** 5 /**
6 * Default implementation of [ListInputStream]. 6 * Default implementation of [ListInputStream].
7 */ 7 */
8 class _ListInputStream extends _BaseDataInputStream implements ListInputStream { 8 class _ListInputStream extends _BaseDataInputStream implements ListInputStream {
9 _ListInputStream() : _bufferList = new _BufferList(); 9 _ListInputStream() : _bufferList = new _BufferList();
10 10
(...skipping 24 matching lines...) Expand all
35 35
36 void _close() { 36 void _close() {
37 _streamMarkedClosed = true; 37 _streamMarkedClosed = true;
38 _bufferList.clear(); 38 _bufferList.clear();
39 } 39 }
40 40
41 _BufferList _bufferList; 41 _BufferList _bufferList;
42 } 42 }
43 43
44 44
45 class _ListOutputStream implements ListOutputStream { 45 class _ListOutputStream extends _BaseOutputStream implements ListOutputStream {
46 _ListOutputStream() : _bufferList = new _BufferList(); 46 _ListOutputStream() : _bufferList = new _BufferList();
47 47
48 List<int> contents() => _bufferList.readBytes(_bufferList.length); 48 List<int> contents() => _bufferList.readBytes(_bufferList.length);
49 49
50 bool write(List<int> buffer, [bool copyBuffer = false]) { 50 bool write(List<int> buffer, [bool copyBuffer = false]) {
51 if (_streamMarkedClosed) throw new StreamException.streamClosed(); 51 if (_streamMarkedClosed) throw new StreamException.streamClosed();
52 if (copyBuffer) { 52 if (copyBuffer) {
53 _bufferList.add(buffer.getRange(0, buffer.length)); 53 _bufferList.add(buffer.getRange(0, buffer.length));
54 } else { 54 } else {
55 _bufferList.add(buffer); 55 _bufferList.add(buffer);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 122
123 _BufferList _bufferList; 123 _BufferList _bufferList;
124 bool _streamMarkedClosed = false; 124 bool _streamMarkedClosed = false;
125 bool _closeCallbackCalled = false; 125 bool _closeCallbackCalled = false;
126 Timer _scheduledNoPendingWriteCallback; 126 Timer _scheduledNoPendingWriteCallback;
127 Timer _scheduledCloseCallback; 127 Timer _scheduledCloseCallback;
128 Function _clientNoPendingWriteHandler; 128 Function _clientNoPendingWriteHandler;
129 Function _clientCloseHandler; 129 Function _clientCloseHandler;
130 } 130 }
OLDNEW
« no previous file with comments | « runtime/bin/input_stream.dart ('k') | runtime/bin/output_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698