this saved 2 allocations and a bunch of bytes due to unnecessary byte[] copying.