1 ! Copyright (C) 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien byte-arrays byte-vectors io kernel libc math
5 IN: io.streams.byte-array.fast
7 ! This is split off from io.streams.byte-array because it uses
8 ! memcpy, which is a non-core word that only works after the
9 ! optimizing compiler has been loaded.
11 M: byte-vector stream-write
13 push-all ! faster than memcpy
15 2dup [ byte-length ] bi@
17 [ tail-slice swap ] curry dip memcpy