diff --git a/CHANGELOG.md b/CHANGELOG.md index 399e8c7bfe93415ff41e8c0ddf5319a8ebec9d37..7a813b9bcd28531bc4fb850ff2e418c110ac49c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Unreleased + ++ Remove check on stream element type. On at least SBCL and ECL, + `*standard-input*` and `*standard-output*` have element type `'character`, + but also allow you to use binary stream functions on them. + ## v0.1.3 - January 02, 2022 + Fix bug with determining type of entries in v7 archives. diff --git a/src/blocked-stream.lisp b/src/blocked-stream.lisp index 91113d601b21dd3f6d9f5598ca0d1280d671f64d..ae87862caf1f3fd614cf3d85be8e2e17ccc50881 100644 --- a/src/blocked-stream.lisp +++ b/src/blocked-stream.lisp @@ -83,16 +83,12 @@ of the wrapped stream when instantiated.")) (defmethod initialize-instance :after ((blocked-stream blocked-stream) &key stream) - (let ((element-type (or (ignore-errors (stream-element-type stream)) - '(unsigned-byte 8)))) - (assert (subtypep element-type 'integer) - nil "STREAM must be a binary stream") - ;; Create the buffer. - (setf (buffer blocked-stream) (make-array (block-size blocked-stream) - :element-type element-type - :initial-element 0) - ;; Record the START-FILE-POSITION - (start-file-position blocked-stream) (ignore-errors (file-position stream))))) + ;; Create the buffer. + (setf (buffer blocked-stream) (make-array (block-size blocked-stream) + :element-type '(unsigned-byte 8) + :initial-element 0) + ;; Record the START-FILE-POSITION + (start-file-position blocked-stream) (ignore-errors (file-position stream)))) (defgeneric discard-buffer (stream) (:documentation