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

Unified Diff: runtime/bin/string_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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/string_stream.dart
diff --git a/runtime/bin/string_stream.dart b/runtime/bin/string_stream.dart
index 8b678997050a5121db9216b3ef82e6d1aad5e008..bedbc55a2fca1b44890fd88ed4224e4f676422ba 100644
--- a/runtime/bin/string_stream.dart
+++ b/runtime/bin/string_stream.dart
@@ -111,6 +111,8 @@ class _StringDecoderBase implements _StringDecoder {
_lastCharCode = charCode;
}
+ int available() => _result.length - _resultOffset;
+
void _recordLineBreakEnd(int charPos) {
_lineBreakEnds.add(charPos);
_lineBreaks++;
@@ -132,7 +134,7 @@ class _StringDecoderBase implements _StringDecoder {
// character positions from the begining of the decoded data.
Queue<int> _lineBreakEnds; // Character position of known line breaks.
int _charOffset = 0; // Character number of the first character in the list.
- int _charCount = 0; // Total number of characters decodes.
+ int _charCount = 0; // Total number of characters decoded.
int _lastCharCode = -1;
final int LF = 10;
@@ -253,6 +255,8 @@ class _StringInputStream implements StringInputStream {
return decodedLine;
}
+ int available() => _decoder.available();
+
String get encoding() => _encoding;
bool get closed() => _inputClosed && _decoder.isEmpty();

Powered by Google App Engine
This is Rietveld 408576698