memory-stream


Vocabulary
io.streams.memory

Definition
IN: io.streams.memory

TUPLE: memory-stream alien ;


Methods
USING: io io.streams.memory kernel ;

M: memory-stream stream-element-type drop +byte+ ;


USING: accessors alien io io.streams.memory libc locals ;

M:: memory-stream stream-read-unsafe
( n buf stream -- count )
stream alien>> :> src buf src n memcpy
n src <displaced-alien> stream alien<< n ; inline


USING: accessors alien alien.accessors io io.streams.memory
kernel ;

M: memory-stream stream-read1
[ 1 over <displaced-alien> ] change-alien drop
0 alien-unsigned-1 ; inline