Commit 401fd05b590f206bf46fafc77db665910fbf2746

Thomas de Grivel 2017-06-17T18:32:54

stream-write-element-to-buffer

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/fd-stream.lisp b/fd-stream.lisp
index 64513a8..d62b125 100644
--- a/fd-stream.lisp
+++ b/fd-stream.lisp
@@ -124,6 +124,14 @@
                      (stream-output-length stream) 0))
              nil)))))
 
+(defmethod stream-write-element-to-buffer ((stream fd-output-stream)
+                                           element)
+  (setf (cffi:mem-aref (stream-output-buffer stream) :unsigned-char
+                       (stream-output-length stream))
+        element)
+  (incf (stream-output-length stream))
+  nil)
+
 (defmethod close ((stream fd-output-stream))
   (flush stream)
   (call-next-method)