Index: runtime/bin/stream_util.dart |
diff --git a/runtime/bin/stream_util.dart b/runtime/bin/stream_util.dart |
index d558bfaabb37cd0838a0f348412058c02d930cd3..f00c4a2e54800d7d0089ffbfc7f19e67a0658108 100644 |
--- a/runtime/bin/stream_util.dart |
+++ b/runtime/bin/stream_util.dart |
@@ -175,3 +175,15 @@ void _pipe(InputStream input, OutputStream output, [bool close]) { |
output.onNoPendingWrites = null; |
} |
+ |
+class _BaseOutputStream { |
+ bool writeString(String string, [Encoding encoding = Encoding.UTF_8]) { |
+ if (string.length > 0) { |
+ // Encode and write data. |
+ StringEncoder encoder = _StringEncoders.encoder(encoding); |
+ List<int> data = encoder.encodeString(string); |
+ return write(data, copyBuffer: false); |
+ } |
+ return true; |
+ } |
+} |