Helper function for getting a load of bytes from a generator