X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=io.lisp;h=4f896ed7584219f32fd425f0fcab74b7cdf5a41b;hp=aedca9942a166d716bf11f44c227d711176ee105;hb=ea921dd2ce51a46bb3ca92a07df095d5ace99dcf;hpb=ea61d4a24131ea7c71d400c4984b6ee93715ae6d diff --git a/io.lisp b/io.lisp index aedca99..4f896ed 100644 --- a/io.lisp +++ b/io.lisp @@ -45,7 +45,7 @@ (defun read-file-to-usb8-array (file) "Opens a reads a file. Returns the contents as single unsigned-byte array" - (with-open-file (in file :direction :input) + (with-open-file (in file :direction :input :element-type '(unsigned-byte 8)) (let* ((file-len (file-length in)) (usb8 (make-array file-len :element-type '(unsigned-byte 8))) (pos (read-sequence usb8 in))) @@ -322,7 +322,7 @@ (write-char #\: stream) (write-string (aref +datetime-number-strings+ minute) stream))) -(defun copy-binary-stream (in out &key (chunk-size 4096)) +(defun copy-binary-stream (in out &key (chunk-size 16384)) (do* ((buf (make-array chunk-size :element-type '(unsigned-byte 8))) (pos (read-sequence buf in) (read-sequence buf in))) ((zerop pos))