anchor.diff:            #\REPLACEMENT_CHARACTER
             (code-char code-point)))))
   
  -(defmethod sys.gray:stream-write-byte ((stream tcp-stream) byte)
  +(defmethod sys.gray:stream-write-byte ((stream tcp-octet-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-octet-stream) sequence &optional (start 0) end)
  +  (unless end (setf end (length sequence)))
  +  (cond ((not (and (zerop start)
  +                   (eql end (length sequence))))
  +         (setf sequence (subseq sequence start end))))
  +  (tcp-send (tcp-stream-connection stream) sequence))
   
   (defmethod sys.gray:stream-write-sequence ((stream tcp-stream) sequence &optional (start 0) end)
     (unless end (setf end (length sequence)))
  
positive.code:     (refill-tcp-stream-buffer stream)
      (not (null (tcp-stream-packet stream)))))
  
  (defmethod sys.gray:stream-read-byte ((stream tcp-stream))
    (with-tcp-connection-locked (tcp-stream-connection stream)
      (when (not (refill-tcp-packet-buffer stream))
        (return-from sys.gray:stream-read-byte :eof))
  
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))))
  