added encoding array to buffer