Estimate or calculate StringBuffer sizes in advance, use iterator over string splits instead of arrays. (#1138)