Chromium Code Reviews| Index: sdk/lib/io/string_stream.dart |
| diff --git a/sdk/lib/io/string_stream.dart b/sdk/lib/io/string_stream.dart |
| index 5d71af4245e6d1ff65f953000a9e87ffcad1c5d6..41b31bfee48e7673e03357581cbd0779b3ef6874 100644 |
| --- a/sdk/lib/io/string_stream.dart |
| +++ b/sdk/lib/io/string_stream.dart |
| @@ -88,19 +88,18 @@ abstract class _StringDecoderBase implements _StringDecoder { |
| String decoded([int len]) { |
| if (isEmpty) return null; |
| - String result; |
| + List<int> result; |
| if (len !== null && len < available()) { |
| - result = new String.fromCharCodes(_result.getRange(_resultOffset, len)); |
| + result = _result.getRange(_resultOffset, len); |
| } else { |
|
Mads Ager (google)
2012/11/07 06:54:40
Let's change this to
if (len !== null && len < av
Bob Nystrom
2012/11/07 17:28:05
Done.
|
| if (_resultOffset == 0) { |
| - result = new String.fromCharCodes(_result); |
| + result = _result; |
| } else { |
| - result = |
| - new String.fromCharCodes( |
| - _result.getRange(_resultOffset, |
| - _result.length - _resultOffset)); |
| + result = _result.getRange(_resultOffset, |
| + _result.length - _resultOffset); |
| } |
| } |
| + |
| _resultOffset += result.length; |
| while (!_lineBreakEnds.isEmpty && |
| _lineBreakEnds.first < _charOffset + _resultOffset) { |
| @@ -108,7 +107,7 @@ abstract class _StringDecoderBase implements _StringDecoder { |
| _lineBreaks--; |
| } |
| if (_result.length == _resultOffset) _resetResult(); |
| - return result; |
| + return new String.fromCharCodes(result); |
| } |
| String get decodedLine { |
| @@ -419,7 +418,7 @@ class _StringInputStream implements StringInputStream { |
| void set onError(void callback(e)) { |
| _input.onError = callback; |
| - _decoder.onError = (e) { |
| + _decoder.onError = (e) { |
| _clientCloseHandler = null; |
| _input.close(); |
| callback(e); |