Skip to content
Snippets Groups Projects
Unverified Commit c36b473e authored by Eric Timmons's avatar Eric Timmons
Browse files

Remove check on STREAM-ELEMENT-TYPE

parent 9f370340
No related branches found
No related tags found
No related merge requests found
## 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 ## v0.1.3 - January 02, 2022
+ Fix bug with determining type of entries in v7 archives. + Fix bug with determining type of entries in v7 archives.
......
...@@ -83,16 +83,12 @@ of the wrapped stream when instantiated.")) ...@@ -83,16 +83,12 @@ of the wrapped stream when instantiated."))
(defmethod initialize-instance :after ((blocked-stream blocked-stream) (defmethod initialize-instance :after ((blocked-stream blocked-stream)
&key &key
stream) stream)
(let ((element-type (or (ignore-errors (stream-element-type stream)) ;; Create the buffer.
'(unsigned-byte 8)))) (setf (buffer blocked-stream) (make-array (block-size blocked-stream)
(assert (subtypep element-type 'integer) :element-type '(unsigned-byte 8)
nil "STREAM must be a binary stream") :initial-element 0)
;; Create the buffer. ;; Record the START-FILE-POSITION
(setf (buffer blocked-stream) (make-array (block-size blocked-stream) (start-file-position blocked-stream) (ignore-errors (file-position stream))))
:element-type element-type
:initial-element 0)
;; Record the START-FILE-POSITION
(start-file-position blocked-stream) (ignore-errors (file-position stream)))))
(defgeneric discard-buffer (stream) (defgeneric discard-buffer (stream)
(:documentation (:documentation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment