Commit 5a1442068e681521d09d342e5c1fdf81d86f3786

Thomas de Grivel 2017-06-17T21:31:40

read

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 5de75be..dbc8805 100644
--- a/fd-stream.lisp
+++ b/fd-stream.lisp
@@ -83,7 +83,13 @@
            (error 'stream-input-error :stream stream))
           (t
            (incf (stream-input-length stream) r)
-           r))))
+           nil))))
+
+(defmethod stream-read-element-from-buffer ((stream fd-input-stream))
+  (let ((element (cffi:mem-aref (stream-input-buffer stream) :unsigned-char
+				(stream-input-index stream))))
+    (incf (stream-input-index stream))
+    (values element nil)))
 
 (defmethod close ((stream fd-input-stream))
   (call-next-method)