preallocate buffer sizes
Merge pull request #2242 from WalterBright/set_outbuf_size

preallocate buffer sizes