1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel accessors alien alien.accessors math io ;
6 TUPLE: memory-stream alien index ;
8 : <memory-stream> ( alien -- stream )
11 M: memory-stream stream-element-type drop +byte+ ;
13 M: memory-stream stream-read1
14 [ [ alien>> ] [ index>> ] bi alien-unsigned-1 ]
15 [ [ 1 + ] change-index drop ] bi ;