Results 1 to 1 of 1
- 03-16-2009, 04: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 06:08 PM. Reason: Posted code works; problem was with IDE
- By computerboyo in forum New To JavaReplies: 2Last Post: 02-26-2009, 12:44 AM
- By taraxgoesxboom in forum New To JavaReplies: 12Last Post: 02-22-2009, 06:29 AM
- By jenni in forum New To JavaReplies: 3Last Post: 02-16-2009, 10:20 PM
- By Java Tip in forum Java TipReplies: 0Last Post: 01-29-2008, 10:06 AM
- By srini in forum New To JavaReplies: 1Last Post: 12-24-2007, 09:03 PM