For a web project I'm writing large sections of text to a webpage(table) or even bigger (could be several MB) to CSV files for download. The java method dealing with this receives a StringBuilder content string, which originally (by the creator of this module) was being sent char by char in a loop:
response.getOutputStream().write(content.charAt(i)).
Upon questioning about the loop, the reason given was that he thought the string might be too big for writing in one go. (using java 1.6). I can't find any size restrictions anywhere, and then also the question came which method to use instead: print() or getWriter()? The data in the string is all text.