modifies []byte in place