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
6 ! This is split off from io.streams.byte-array because it uses
7 ! memcpy, which is a non-core word that only works after the
8 ! optimizing compiler has been loaded.
10 M: byte-vector stream-write
12 push-all ! faster than memcpy
14 2dup [ byte-length ] bi@
16 [ tail-slice swap ] curry dip memcpy