refactors concat-byte-array for simplicity and proper content-length