• Post Reply Bookmark Topic Watch Topic
  • New Topic

OutputStreamWriter limitations.  RSS feed

 
Bhasker Reddy
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This also belongs in the IO and Streams forum. I will move it there.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!