Results 1 to 2 of 2
Thread: Adding print streams together
- 04-21-2012, 09:17 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 53
- Rep Power
- 0
Adding print streams together
Hello, im working on a program, however i have a need to have 2 print streams and i wish to add the contents of one to another
The problem is i cant declare writer 2 without giving it a file url the same as newwriter, so basically i end up with 2 files when i only really want one, but it is required of me to maintain both streams. I have also tried using the writer class and appending that to writer but it just outputs java.io.FileWriter@6e1408. Any help would be greatJava Code:private static PrintStream newwriter; private static PrintStream writer2; newwriter = new PrintStream("test.txt"); writer2 = new PrintStream(); // dont want a new file output, just need the stream //what i want to do writer2.append("test sentence"); newwriter.print(writer2);
- 04-22-2012, 02:15 AM #2
Similar Threads
-
Adding print streams
By trishtren in forum New To JavaReplies: 0Last Post: 04-21-2012, 07:44 PM -
Cmd process streams
By helloworld922 in forum Advanced JavaReplies: 0Last Post: 10-20-2010, 08:20 AM -
Print the text file and print preview them
By Java Tip in forum java.awtReplies: 0Last Post: 06-22-2008, 11:04 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks