Byte vectors
Factor handbook » The language » Collections

Prev:Vectors
Next:String buffers


The byte-vectors vocabulary implements resizable mutable sequence of unsigned bytes. Byte vectors implement the Sequence protocol and thus all Sequence operations can be used with them.

Byte vectors form a class:
byte-vector

byte-vector? ( object -- ? )


Creating byte vectors:
>byte-vector ( seq -- byte-vector )

<byte-vector> ( n -- byte-vector )


Literal syntax:
BV{


If you don't care about initial capacity, a more elegant way to create a new byte vector is to write:
BV{ } clone