response truncated after switch from ServletOutputStream to OutputStreamWriter



I had a servlet that was writing html output using;

ServletOutputStream out = response.getOutputStream();
out.println(" ... ");
etc...

I changed this to:
ServletOutputStream out = response.getOutputStream();
OutputStreamWriter outputWriter = new OutputStreamWriter(out);
outputWriter.write(" ... ");
etc...

Now when I browse to the Servlet I get _most_ of the HTML printed to my browser, but the output seems to stop after a certain number of characters.  Is there something wrong with the way I'm using OutputStreamWriter; odes it have a finite buffer size?


LVL 5
blackfrancis75Asked:
Who is Participating?
 
objectsCommented:
try doing a flush() after you've written all the output
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.