resize-byte-array ( n byte-array -- new-byte-array )
Factor handbook » The language » Collections » Byte arrays

Prev:4byte-array ( w x y z -- byte-array )


Vocabulary
byte-arrays

Inputs
na non-negative integer
byte-arraya byte-array


Outputs
new-byte-arraya byte-array


Word description
Resizes the byte array to have a length of n elements. When making the byte array shorter, this word may either create a new byte array or modify the existing byte array in place. When making the byte array longer, this word always allocates a new byte array, filling remaining space with zeroes.

Side effects
Modifies byte-array

Definition

PRIMITIVE: resize-byte-array ( n byte-array -- new-byte-array )