Results 1 to 1 of 1
- 03-16-2009, 03:44 PM #1Member
- Join Date
- Feb 2009
- Rep Power
[SOLVED] Converting output stream to string
I want to convert an output stream into something that I can display. I put together the following code, but it only display incoherent text.
1. I do not have a preference for the output stream type. I just want to display the converted string in the console viewer, i.e. "System.out.println()"
2. request.writeRequest(outStream); - writes to output stream
ByteArrayOutputStream outStream = new ByteArrayOutputStream(); ... ... MultipartRequestEntity request = new MultipartRequestEntity( parts, post.getParams() ); request.writeRequest(outStream); System.out.println( outStream.toString() );
Last edited by dan0; 03-16-2009 at 05:08 PM. Reason: Posted code works; problem was with IDE
- By computerboyo in forum New To JavaReplies: 2Last Post: 02-25-2009, 11:44 PM
- By taraxgoesxboom in forum New To JavaReplies: 12Last Post: 02-22-2009, 05:29 AM
- By jenni in forum New To JavaReplies: 3Last Post: 02-16-2009, 09:20 PM
- By Java Tip in forum Java TipReplies: 0Last Post: 01-29-2008, 09:06 AM
- By srini in forum New To JavaReplies: 1Last Post: 12-24-2007, 08:03 PM