Commit a67c3a6c authored by Philipp Marek's avatar Philipp Marek
Browse files

Merge #24.

parents 6352e599 6ff6820c
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -53,9 +53,10 @@ which is only sent to WITH-OPEN-FILE when it's not NIL."
(defun read-stream-content-into-string (stream &key (buffer-size 4096))
  "Return the \"content\" of STREAM as a fresh string."
  (check-type buffer-size positive-integer)
  (let ((*print-pretty* nil))
    (with-output-to-string (datum)
      (let ((buffer (make-array buffer-size :element-type 'character)))
  (let ((*print-pretty* nil)
        (element-type (stream-element-type stream)))
    (with-output-to-string (datum nil :element-type element-type)
      (let ((buffer (make-array buffer-size :element-type element-type)))
        (loop
          :for bytes-read = (read-sequence buffer stream)
          :do (write-sequence buffer datum :start 0 :end bytes-read)