anchor.diff:    (declare (ignore host))
     ())
   
  -(defclass http-binary-stream (file-cache-stream)
  -  ((path :initarg :path :reader path)))
  -
  -(defclass http-character-stream (file-cache-character-stream)
  -  ((path :initarg :path :reader path)))
  +(defclass http-binary-stream (mezzano.gray:fundamental-binary-input-stream
  +                              file-stream)
  +  ((path :initarg :path :reader path)
  +   (position :initarg :position :accessor stream-position)
  +   (buffer :initarg :buffer :reader stream-buffer)))
  +
  +(defclass http-character-stream (mezzano.gray:fundamental-character-input-stream
  +                                 file-stream)
  +  ((path :initarg :path :reader path)
  +   (position :initarg :position :accessor stream-position)
  +   (buffer :initarg :buffer :reader stream-buffer)))
   
   (defmethod print-object ((object http-binary-stream) stream)
     (print-unreadable-object (object stream :type t :identity t)
  
positive.code:   (if (mezzano.internals::type-equal element-type 'character)
        (make-instance 'http-character-stream
                       :path pathname
                       :direction :input
                       :buffer body
                       :length (length body)
                       :external-format (mezzano.internals::make-external-format
                                         'character external-format))
        (make-instance 'http-binary-stream
                       :path pathname
                       :direction :input
                       :buffer body
                       :length (length body))))
  
  (defun decode-location (location)
    ;; This should parse an absoluteURI from rfc2396.
  
negative.code:                 :format-control "HTTP ~D ~A"
                  :format-arguments (list status-code reason-phrase)))))))
  
  (defmethod mezzano.gray:stream-element-type ((stream http-binary-stream))
    (declare (ignore stream))
    '(unsigned-byte 8))
  
  (defmethod mezzano.gray:stream-read-byte ((stream http-binary-stream))
    (cond ((>= (stream-position stream)
               (length (stream-buffer stream)))
           :eof)
          (t (prog1
                 (aref (stream-buffer stream) (stream-position stream))
               (incf (stream-position stream))))))
  
  (defmethod mezzano.gray:stream-file-position ((stream http-binary-stream) &optional (position-spec nil position-specp))
    (cond (position-specp
           (setf (stream-position stream)
                 (case position-spec
                   (:start 0)
                   (:end (length (stream-buffer stream)))
                   (t position-spec))))
          (t (stream-position stream))))
  
  (defmethod mezzano.gray:stream-file-length ((stream http-binary-stream))
    (length (stream-buffer stream)))
  
  (defmethod mezzano.gray:stream-element-type ((stream http-character-stream))
    'character)
  
  (defmethod mezzano.gray:stream-read-char ((stream http-character-stream))
    (cond ((>= (stream-position stream)
               (length (stream-buffer stream)))
           :eof)
          (t (prog1
                 (aref (stream-buffer stream) (stream-position stream))
               (incf (stream-position stream))))))
  
  (defmethod mezzano.gray:stream-file-position ((stream http-character-stream) &optional (position-spec nil position-specp))
    (cond (position-specp
           (setf (stream-position stream)
                 (case position-spec
                   (:start 0)
                   (:end (length (stream-buffer stream)))
                   (t position-spec))))
          (t (stream-position stream))))
  
  (defmethod mezzano.gray:stream-file-length ((stream http-character-stream))
    (length (stream-buffer stream)))
  
  (defmethod directory-using-host ((host http-host) pathname &key)
    (declare (ignore host pathname))
    '())
  