anchor.diff:  
   (defmethod zstream-fill-input ((buffer single-channel-buffer) &key timeout)
     (with-synchronized-buffer (buffer :input)
  -    (%zstream-flush-output buffer)
  +    (%zstream-flush-output buffer timeout)
       (%zstream-fill-input buffer timeout)))
   
   (defmethod zstream-fill-input ((buffer dual-channel-buffer) &key timeout)
  
positive.code:           (+ position (iobuf-available-octets (%db-output-iobuf buffer)))
            (- position (iobuf-available-octets (%db-input-iobuf buffer)))))))
  
  (defmethod zstream-io-position ((buffer dual-channel-buffer))
    (device-position (zstream-device buffer)))
  
  (defmethod zstream-io-position ((buffer memory-buffer))
    ;; FIXME: signal proper error
    (error "~S is a dual-cursor stream" buffer))
  
  (defmethod (setf zstream-io-position)
      (position (buffer device-buffer) &optional (from :start))
    (setf (device-position (zstream-device buffer) from) position))
  
  (defmethod (setf zstream-io-position)
      (position (buffer memory-buffer) &optional from)
    (declare (ignore position from))
    ;; FIXME: signal proper error
    (error "~S is a dual-cursor stream" buffer))
  
  
  ;;;-------------------------------------------------------------------------
  ;;; INPUT-POSITION
  ;;;-------------------------------------------------------------------------
  
  (defmethod zstream-input-position ((buffer device-buffer))
    ;; FIXME: signal proper error
    (error "~S is a single-cursor stream" buffer))
  
  (defmethod (setf zstream-input-position)
      (offset (buffer device-buffer) &optional from)
    (declare (ignore offset from))
    ;; FIXME: signal proper error
    (error "~S is a single-cursor stream" buffer))
  
  (defmethod zstream-input-position ((buffer memory-buffer))
    (%mb-input-position buffer))
  
  (defmethod (setf zstream-input-position)
      (offset (buffer memory-buffer) &optional (from :start))
    (with-accessors ((data-vector %mb-data-vector)
                     (input-position %mb-input-position)
                     (output-position %mb-output-position))
        buffer
      (let ((len (length data-vector))
            (newpos
             (ecase from
               (:start   offset)
               (:current (+ input-position offset))
               (:output  (+ output-position offset)))))
        ;; FIXME: signal proper condition
        (assert (< output-position len))
        (unless (and (<= newpos output-position))
          ;; FIXME: signal proper condition
          (error "Wrong sequence bounds. start: ~S end: ~S"
                 newpos output-position))
        (setf input-position newpos))))
  
  
  ;;;-------------------------------------------------------------------------
  ;;; OUTPUT-POSITION
  ;;;-------------------------------------------------------------------------
  
  (defmethod zstream-output-position ((buffer device-buffer))
    ;; FIXME: signal proper error
    (error "~S is a single-cursor stream" buffer))
  
  (defmethod (setf zstream-output-position)
      (offset (buffer device-buffer) &optional from)
    (declare (ignore offset from))
    ;; FIXME: signal proper error
    (error "~S is a single-cursor stream" buffer))
  
  (defmethod zstream-output-position ((buffer memory-buffer))
    (%mb-output-position buffer))
  
  (defmethod (setf zstream-output-position)
      (offset (buffer memory-buffer) &optional (from :start))
    (with-accessors ((data-vector %mb-data-vector)
                     (input-position %mb-input-position)
                     (output-position %mb-output-position)
                     (adjust-size %mb-adjust-size))
        buffer
      (let ((newpos
             (ecase from
               (:start   offset)
               (:current (+ output-position offset))
               (:input   (+ input-position offset)))))
        (check-bounds data-vector input-position newpos)
        (%ensure-memory-buffer-capacity buffer (- newpos output-position))
        (setf output-position newpos))))
  
  
  
negative.code: 
  ;;; Device buffer functions
  
  (defgeneric zstream-position (buffer &key direction))
  
  (defgeneric (setf zstream-position) (position buffer &key direction from))
  
  (defgeneric zstream-poll (buffer &key direction timeout))
  
  