anchor.diff:          (le:evbuffer-drain bev-input 9999999)))))
   
   (defmethod stream-read-byte ((stream async-input-stream))
  +  "Read one byte from the underlying socket."
     (let ((byte (as::read-bytes-from-socket (stream-socket stream) 1)))
       (if byte
           (aref byte 0)
           :eof)))
   
   (defmethod stream-read-sequence ((stream async-input-stream) sequence start end &key)
  +  "Attempt to read a sequence of bytes from the underlying socket."
     (let ((seq (as::read-bytes-from-socket (stream-socket stream) (- end start))))
       (if seq
           (progn
  
positive.code: (in-package :cl-async)
  
  (defclass async-stream (trivial-gray-stream-mixin)
    ((socket :accessor stream-socket :initarg :socket :initform nil)))
  (defclass async-output-stream (fundamental-binary-output-stream async-stream) ())
  (defclass async-input-stream (fundamental-binary-input-stream async-stream) ())
  (defclass async-io-stream (async-input-stream async-output-stream) ())
  
  ;; -----------------------------------------------------------------------------
  ;; base stream
  ;; -----------------------------------------------------------------------------
  (defmethod stream-output-type ((stream async-stream))
    '(unsigned-byte 8))
  
  (defmethod open-stream-p ((stream async-stream))
    (let ((socket (stream-socket stream)))
      (not (as:socket-closed-p socket))))
  
  (defmethod close ((stream async-stream) &key abort)
    (declare (ignore abort))
    (as:close-socket (stream-socket stream)))
  
  ;; -----------------------------------------------------------------------------
  ;; output stream
  ;; -----------------------------------------------------------------------------
  (defmethod stream-clear-output ((stream async-output-stream))
    (when (open-stream-p stream)
      (let* ((socket (stream-socket stream))
             (bev (socket-c socket))
  
negative.code: ;; input stream
  ;; -----------------------------------------------------------------------------
  (defmethod stream-clear-input ((stream async-input-stream))
    "Attempt to clear the input buffer of an input stream."
    (when (open-stream-p stream)
      (let* ((socket (stream-socket stream))
             (bev (socket-c socket))
  