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

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

Issue 9546003: Add method available to StringInputStream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « no previous file | runtime/bin/string_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 * Basic input stream which supplies binary data. 6 * Basic input stream which supplies binary data.
7 * 7 *
8 * Input streams are used to read data sequentially from some data 8 * Input streams are used to read data sequentially from some data
9 * source. All input streams are non-blocking. They each have a number 9 * source. All input streams are non-blocking. They each have a number
10 * of read calls which will always return without any IO related 10 * of read calls which will always return without any IO related
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 String read(); 118 String read();
119 119
120 /** 120 /**
121 * Reads the next line from the stream. The line ending characters 121 * Reads the next line from the stream. The line ending characters
122 * will not be part of the returned string. If a full line is not 122 * will not be part of the returned string. If a full line is not
123 * available null will be returned. 123 * available null will be returned.
124 */ 124 */
125 String readLine(); 125 String readLine();
126 126
127 /** 127 /**
128 * Returns the number of characters available for immediate
129 * reading. Note that this includes all characters that will be in
130 * the String returned from [read] this includes line breaking
131 * characters. If [readLine] is used for reading one can observe
132 * less characters being returned as the line breaking characters
Dan Rice 2012/03/06 15:06:56 less -> fewer
133 * are discarded.
134 */
135 int available();
136
137 /**
128 * Returns whether the stream has been closed. There might still be 138 * Returns whether the stream has been closed. There might still be
129 * more data to read. 139 * more data to read.
130 */ 140 */
131 bool get closed(); 141 bool get closed();
132 142
133 /** 143 /**
134 * Returns the encoding used to decode the binary data into characters. 144 * Returns the encoding used to decode the binary data into characters.
135 */ 145 */
136 String get encoding(); 146 String get encoding();
137 147
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 void set onError(void callback()); 227 void set onError(void callback());
218 } 228 }
219 229
220 230
221 class StreamException implements Exception { 231 class StreamException implements Exception {
222 const StreamException([String this.message = ""]); 232 const StreamException([String this.message = ""]);
223 const StreamException.streamClosed() : message = "Stream closed"; 233 const StreamException.streamClosed() : message = "Stream closed";
224 String toString() => "StreamException: $message"; 234 String toString() => "StreamException: $message";
225 final String message; 235 final String message;
226 } 236 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/string_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698