Repack bytes to string before writing to socket