resize-byte-array ( n byte-array -- new-byte-array ) (original) (raw)

Vocabulary
byte-arrays

Inputs

n a non-negative integer
byte-array a byte-array

Outputs

new-byte-array a 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

IN: byte-arrays

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