buffer: remove unnecessary encoding within writeInt*

On my machine it gives a performance of 2 times.