Preallocate Buffer for faster writes