1 USING: help.markup help.syntax sequences ;
4 ARTICLE: "byte-vectors" "Byte vectors"
5 "The " { $vocab-link "byte-vectors" } " vocabulary implements resizable mutable sequence of unsigned bytes. Byte vectors implement the " { $link "sequence-protocol" } " and thus all " { $link "sequences" } " can be used with them."
7 "Byte vectors form a class:"
12 "Creating byte vectors:"
18 { $subsections POSTPONE: BV{ }
19 "If you don't care about initial capacity, a more elegant way to create a new byte vector is to write:"
20 { $code "BV{ } clone" } ;
25 { $description "The class of resizable byte vectors. See " { $link "byte-vectors" } " for information." } ;
28 { $values { "n" "a positive integer specifying initial capacity" } { "byte-vector" byte-vector } }
29 { $description "Creates a new byte vector that can hold " { $snippet "n" } " bytes before resizing." } ;
32 { $values { "seq" sequence } { "byte-vector" byte-vector } }
33 { $description "Outputs a freshly-allocated byte vector with the same elements as a given sequence." }
34 { $errors "Throws an error if the sequence contains elements other than integers." } ;
37 { $syntax "BV{ elements... }" }
38 { $values { "elements" "a list of bytes" } }
39 { $description "Marks the beginning of a literal byte vector. Literal byte vectors are terminated by " { $link POSTPONE: } } "." }
40 { $examples { $code "BV{ 1 2 3 12 }" } } ;