| Index: sdk/lib/io/stdio.dart
|
| diff --git a/sdk/lib/io/stdio.dart b/sdk/lib/io/stdio.dart
|
| index 8f1c6256dccb045ebeabd949205f05421b1dd09e..7bc5bd677b94ec2eb8161324e3c6e7d234e8fce3 100644
|
| --- a/sdk/lib/io/stdio.dart
|
| +++ b/sdk/lib/io/stdio.dart
|
| @@ -183,7 +183,7 @@ class Stdin extends _StdStream implements Stream<List<int>> {
|
| * This class can also be used to check whether `stdout` or `stderr` is
|
| * connected to a terminal and query some terminal properties.
|
| */
|
| -class Stdout extends _StdFileSink implements IOSink {
|
| +class Stdout extends _StdSink implements IOSink {
|
| final int _fd;
|
| IOSink _nonBlocking;
|
|
|
| @@ -300,42 +300,30 @@ class _StdConsumer implements StreamConsumer<List<int>> {
|
| }
|
| }
|
|
|
| -class _StdSinkHelper implements IOSink {
|
| +class _StdSink implements IOSink {
|
| final IOSink _sink;
|
| final bool _isTranslatable;
|
|
|
| - _StdSinkHelper(this._sink, this._isTranslatable);
|
| + _StdSink(this._sink);
|
|
|
| Encoding get encoding => _sink.encoding;
|
| void set encoding(Encoding encoding) {
|
| _sink.encoding = encoding;
|
| }
|
|
|
| - void set _translation(_FileTranslation t) {
|
| - if (_isTranslatable) {
|
| - _IOSinkImpl sink = _sink;
|
| - _StdConsumer target = sink._target;
|
| - target._file.translation = t;
|
| - }
|
| - }
|
| -
|
| void write(object) {
|
| - _translation = _FileTranslation.text;
|
| _sink.write(object);
|
| }
|
|
|
| void writeln([object = ""]) {
|
| - _translation = _FileTranslation.text;
|
| _sink.writeln(object);
|
| }
|
|
|
| void writeAll(objects, [sep = ""]) {
|
| - _translation = _FileTranslation.text;
|
| _sink.writeAll(objects, sep);
|
| }
|
|
|
| void add(List<int> data) {
|
| - _translation = _FileTranslation.binary;
|
| _sink.add(data);
|
| }
|
|
|
| @@ -344,29 +332,15 @@ class _StdSinkHelper implements IOSink {
|
| }
|
|
|
| void writeCharCode(int charCode) {
|
| - _translation = _FileTranslation.text;
|
| _sink.writeCharCode(charCode);
|
| }
|
|
|
| - Future addStream(Stream<List<int>> stream) {
|
| - _translation = _FileTranslation.binary;
|
| - return _sink.addStream(stream);
|
| - }
|
| -
|
| + Future addStream(Stream<List<int>> stream) => _sink.addStream(stream);
|
| Future flush() => _sink.flush();
|
| Future close() => _sink.close();
|
| Future get done => _sink.done;
|
| }
|
|
|
| -class _StdFileSink extends _StdSinkHelper {
|
| - // The target of `sink` is expected to be a _StdConsumer.
|
| - _StdFileSink(IOSink sink) : super(sink, true);
|
| -}
|
| -
|
| -class _StdSocketSink extends _StdSinkHelper {
|
| - _StdSocketSink(IOSink sink) : super(sink, false);
|
| -}
|
| -
|
| /// The type of object a standard IO stream is attached to.
|
| class StdioType {
|
| static const StdioType TERMINAL = const StdioType._("terminal");
|
|
|