anchor.diff:                                     (subseq data start end))
                                  :psh-p t))))))))
   
  +(defclass tcp-octet-stream (sys.gray:fundamental-binary-input-stream
  +                            sys.gray:fundamental-binary-output-stream)
  +  ((connection :initarg :connection :reader tcp-stream-connection)
  +   (current-packet :initform nil :accessor tcp-stream-packet)))
  +
   (defclass tcp-stream (sys.gray:fundamental-character-input-stream
                         sys.gray:fundamental-character-output-stream
  -                      sys.gray:fundamental-binary-input-stream
  -                      sys.gray:fundamental-binary-output-stream
  +                      tcp-octet-stream
                         sys.gray:unread-char-mixin)
  -  ((connection :initarg :connection :reader tcp-stream-connection)
  -   (current-packet :initform nil :accessor tcp-stream-packet)))
  +  ())
   
   (defun refill-tcp-stream-buffer (stream)
     (let ((connection (tcp-stream-connection stream)))
  
positive.code:           #\REPLACEMENT_CHARACTER
            (code-char code-point)))))
  
  (defmethod sys.gray:stream-write-byte ((stream tcp-stream) byte)
    (let ((ary (make-array 1 :element-type '(unsigned-byte 8)
                           :initial-element byte)))
      (tcp-send (tcp-stream-connection stream) ary)))
  
  (defmethod sys.gray:stream-write-sequence ((stream tcp-stream) sequence &optional (start 0) end)
    (unless end (setf end (length sequence)))
  
negative.code:   (sys.gray:stream-write-sequence stream (string character))
    character)
  
  (defmethod close ((stream tcp-octet-stream) &key abort)
    (declare (ignore abort))
    (close-tcp-connection (tcp-stream-connection stream)))
  
  (defmethod stream-element-type ((stream tcp-octet-stream))
    '(unsigned-byte 8))
  
  (defun tcp-stream-connect (address port &key element-type)
    (cond ((or (not element-type)
               (and (subtypep element-type 'character)
                    (subtypep 'character element-type)))
           (make-instance 'tcp-stream
                          :connection (tcp-connect (sys.net::resolve-address address) port)))
          ((and (subtypep element-type '(unsigned-byte 8))
                (subtypep '(unsigned-byte 8) element-type))
           (make-instance 'tcp-octet-stream
                          :connection (tcp-connect (sys.net::resolve-address address) port)))
          (t
           (error "Unsupported element type ~S" element-type))))
  