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 )


Inputs and outputs
na non-negative integer
byte-arraya byte-array
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


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