IntelliJ Java IDE
The moose likes I/O and Streams and the fly likes OutputStreamWriter  limitations. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "OutputStreamWriter  limitations." Watch "OutputStreamWriter  limitations." New topic
Author

OutputStreamWriter limitations.

Bhasker Reddy
Ranch Hand

Joined: Jun 13, 2000
Posts: 176
File oldfile = new File("C:/XML/xmlfile" +".xml");//bc (bg6346) 01/18/02
OutputStreamWriter oos = new OutputStreamWriter(new FileOutputStream(oldfile));//bc (bg6346) 01/18/02
String line1 = "";//bc (bg6346) 01/18/02

/*******************end of bhasker's code***************************/


String line = "";
String xmlString = "";
while ( (line = in.readLine()) != null ) {
xmlString += line + "\n";
line1 = decode(line);//bc (bg6346) 01/18/02
line1 = line1.substring(10); //bc (bg6346) 01/18/02
oos.write(line1);//bc (bg6346) 01/18/02
System.out.println("CREATING AND SAVING THE XML FILE"); //bc (bg6346) 01/18/02

}
I am writing to an file using outputStream writer.
The file is around 315 lines. Somehow it is not
writing the complete file. It writes only 305 lines, sometimes 291 lines.
does any of you have any idea.
If you want i can give the input string and
the exact code


Bhasker Reddy
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
This also belongs in the IO and Streams forum. I will move it there.


Matthew Phillips
 
 
subject: OutputStreamWriter limitations.
 
Threads others viewed
Read n Modify Text file
Writing to a file in Java..?
unable to remove spaces in xml
save a xml file using java
Error Validating huge XSD with XML in a Servlet
IntelliJ Java IDE