anchor.diff:     * Data types allowed: [TypedData] (f.e. [Uint8List]), [List]<int>, [int]
      */
     @override
  -  void add(dynamic bytes, [int offset, int length]) {
  -    if(_buffer == null)
  -      throw new StateError("This sink has already been closed.");
  +  void add(dynamic/*TypedData|List<int>|int*/ bytes, [int offset, int length]) {
  +    _ensureNotClosed();
       // test for typed_data
       if(bytes is TypedData) {
         offset = offset == null ? 0 : offset;
         length = length == null ? bytes.lengthInBytes - offset : length;
         if(offset < 0 || length < 0 || offset > bytes.lengthInBytes ||
  -      (offset + length) > bytes.lengthInBytes || (offset + length) < 0) {
  +          (offset + length) > bytes.lengthInBytes || (offset + length) < 0) {
           throw new ArgumentError("Invalid offset or lenght.");
         } else if(length == 0) {
           return;
         }
         int newCount = _count + length;
  -      if(newCount > _buffer.length)
  -        _increaseBufferSize(newCount);
  +      _ensureBufferSize(newCount);
         ByteBuffer bytesBuffer = bytes.buffer;
  -      _buffer.setRange(_count, _count + length, bytesBuffer.asUint8List(bytes.offsetInBytes + offset, length));
  +      _buffer.setRange(_count, newCount, bytesBuffer.asUint8List(bytes.offsetInBytes + offset, length));
         _count = newCount;
       }
       // test for List<int>
  
positive.code:    * Reset the sink to an empty one.
     */
    void reset() {
      if(_buffer == null)
        throw new StateError("This sink has already been closed.");
      _count = 0;
    }
  
  
negative.code:    * Retrieve the content of the sink as a [Uint8List].
     */
    Uint8List toUint8List([int offset = 0, int length]) {
      _ensureNotClosed();
      if(length == null)
        length = _count;
      if(offset < 0 || length < 0 || (offset + length) > _count || (offset + length) < 0)
        throw new ArgumentError("Offset and length values of $offset and $length invalid for sink size $_count");
      return _buffer.buffer.asUint8List(offset, length);
    }
  
    /**
     * Retrieve the content of the sink as a [ByteData] object.
     */
    ByteData toByteData() {
      _ensureNotClosed();
      return _buffer.buffer.asByteData(0, _count);
    }
  
    /**
  