which returns CHARACTER."))
(defmethod stream-element-type ((stream ansi-stream))
- (funcall (ansi-stream-misc stream) stream :element-type))
+ (ansi-stream-element-type stream))
(defmethod stream-element-type ((stream fundamental-character-stream))
'character)
called on the stream."))
(defmethod pcl-open-stream-p ((stream ansi-stream))
- (not (eq (ansi-stream-in stream) #'closed-flame)))
+ (ansi-stream-open-stream-p stream))
(defmethod pcl-open-stream-p ((stream fundamental-stream))
(stream-open-p stream))
to clean up the side effects of having created the stream."))
(defmethod pcl-close ((stream ansi-stream) &key abort)
- (when (open-stream-p stream)
- (funcall (ansi-stream-misc stream) stream :close abort))
- t)
+ (ansi-stream-close stream abort))
(defmethod pcl-close ((stream fundamental-stream) &key abort)
(declare (ignore abort))
(:documentation "Can STREAM perform input operations?"))
(defmethod input-stream-p ((stream ansi-stream))
- (and (not (eq (ansi-stream-in stream) #'closed-flame))
- (or (not (eq (ansi-stream-in stream) #'ill-in))
- (not (eq (ansi-stream-bin stream) #'ill-bin)))))
+ (ansi-stream-input-stream-p stream))
(defmethod input-stream-p ((stream fundamental-input-stream))
t)
(:documentation "Can STREAM perform output operations?"))
(defmethod output-stream-p ((stream ansi-stream))
- (and (not (eq (ansi-stream-in stream) #'closed-flame))
- (or (not (eq (ansi-stream-out stream) #'ill-out))
- (not (eq (ansi-stream-bout stream) #'ill-bout)))))
+ (ansi-stream-output-stream-p stream))
(defmethod output-stream-p ((stream fundamental-output-stream))
t)
&optional (start 0) (end nil))
(basic-io-type-stream-read-sequence stream seq start end
#'stream-read-char))
+
+(defmethod stream-read-sequence ((stream fundamental-binary-input-stream)
+ (seq sequence)
+ &optional (start 0) (end nil))
+ (basic-io-type-stream-read-sequence stream seq start end
+ #'stream-read-byte))
+
\f
;;; character output streams
;;;
(:documentation
"Implements WRITE-BYTE; writes the integer to the stream and
returns the integer as the result."))
+
+;; Provide a reasonable default for binary Gray streams. We might be
+;; able to do better by specializing on the sequence type, but at
+;; least the behaviour is reasonable. --tony 2003/05/08.
+(defmethod stream-write-sequence ((stream fundamental-binary-output-stream)
+ (seq sequence)
+ &optional (start 0) (end nil))
+ (basic-io-type-stream-write-sequence stream seq start end
+ #'stream-write-byte))
+
\f
;;; This is not in the Gray stream proposal, so it is left here
;;; as example code.