29 Oct
2011
29 Oct
'11
11:18 a.m.
I'm wondering how STRING-TO-OCTETS can be used with a fixed sized byte buffer. For example we want to write a long string to a byte stream using a fixed size byte buffer. STRING-TO-OCTETS seems to return the buffer and the number of bytes written. E.g. (let ((buffer (make-array 20 :element-type '(unsigned-byte 8))) (string (make-string 100 :initial-element #\a))) (stream:string-to-octets string :external-format :utf32 :buffer buffer)) Returns a new vector (non-eq to buffer) and 404. Shouldn't one return value also indicate how many characters were converted so that the conversion can be continued at that character offset without allocating a fresh buffer? Helmut