| OLD | NEW |
| 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 _BaseDataInputStream { | 5 class _BaseDataInputStream { |
| 6 abstract int available(); | 6 abstract int available(); |
| 7 | 7 |
| 8 List<int> read([int len]) { | 8 List<int> read([int len]) { |
| 9 if (_closeCallbackCalled) return null; | 9 if (_closeCallbackCalled) return null; |
| 10 int bytesToRead = available(); | 10 int bytesToRead = available(); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 input.onData = pipeDataHandler; | 173 input.onData = pipeDataHandler; |
| 174 input.onClosed = pipeCloseHandler; | 174 input.onClosed = pipeCloseHandler; |
| 175 output.onNoPendingWrites = null; | 175 output.onNoPendingWrites = null; |
| 176 } | 176 } |
| 177 | 177 |
| 178 | 178 |
| 179 class _BaseOutputStream { | 179 class _BaseOutputStream { |
| 180 bool writeString(String string, [Encoding encoding = Encoding.UTF_8]) { | 180 bool writeString(String string, [Encoding encoding = Encoding.UTF_8]) { |
| 181 if (string.length > 0) { | 181 if (string.length > 0) { |
| 182 // Encode and write data. | 182 // Encode and write data. |
| 183 StringEncoder encoder = _StringEncoders.encoder(encoding); | 183 _StringEncoder encoder = _StringEncoders.encoder(encoding); |
| 184 List<int> data = encoder.encodeString(string); | 184 List<int> data = encoder.encodeString(string); |
| 185 return write(data, copyBuffer: false); | 185 return write(data, copyBuffer: false); |
| 186 } | 186 } |
| 187 return true; | 187 return true; |
| 188 } | 188 } |
| 189 } | 189 } |
| OLD | NEW |