anchor.diff:  part of dart.io;
   
   /**
  - * Helper class to wrap a [StreamConsumer<List<int>>] and provide
  - * utility functions for writing to the StreamConsumer directly. The
  - * [IOSink] buffers the input given by all [StringSink] methods and will delay
  - * an [addStream] until the buffer is flushed.
  + * A combined byte and text output.
    *
  - * When the [IOSink] is bound to a stream (through [addStream]) any call
  - * to the [IOSink] will throw a [StateError]. When the [addStream] completes,
  - * the [IOSink] will again be open for all calls.
  + * An [IOSink] combines a [StreamSink] of bytes with a [StringSink],
  + * and allows easy output of both bytes and text.
  + *
  + * Writing text ([write]) and adding bytes ([add]) may be interleaved freely.
  + *
  + * While a stream is being added using [addStream], any further attempts
  + * to add or write to the [IOSink] will fail until the [addStream] completes.
    *
    * If data is added to the [IOSink] after the sink is closed, the data will be
    * ignored. Use the [done] future to be notified when the [IOSink] is closed.
    */
   abstract class IOSink implements StreamSink<List<int>>, StringSink {
  -  // TODO(ajohnsen): Make _encodingMutable an argument.
  +
  +  /**
  +   * Create an [IOSink] that outputs to a [target] [StreamConsumer] of bytes.
  +   *
  +   * Text written to [StreamSink] methods is encoded to bytes using [encoding]
  +   * before being output on [target].
  +   */
     factory IOSink(StreamConsumer<List<int>> target,
                    {Encoding encoding: UTF8})
         => new _IOSinkImpl(target, encoding);
  
positive.code:     _target.close().then(_completeDoneValue, onError: _completeDoneError);
    }
  
    Future get done => _doneFuture;
  
    void _completeDoneValue(value) {
      if (_doneCompleter == null) return;
      _doneCompleter.complete(value);
      _doneCompleter = null;
    }
  
    void _completeDoneError(error, StackTrace stackTrace) {
      if (_doneCompleter == null) return;
      _hasError = true;
      _doneCompleter.completeError(error, stackTrace);
      _doneCompleter = null;
    }
  
    StreamController<T> get _controller {
  
negative.code:     var future = _controllerCompleter.future;
      _controllerInstance.close();
      return future.whenComplete(() {
        _isBound = false;
      });
    }
  
    Future close() {
  