Thank you mailmur. Using fw.flush and fw.close did solve my problem.
Regards, Prabhakar ----- Original Message ---- From: mailmur <[EMAIL PROTECTED]> To: Velocity Users List <[email protected]> Sent: Saturday, December 30, 2006 8:36:24 AM Subject: Re: Velocity & FileWriter 32K limit? > I am using velocity to generate sql. When I use a > StringWriter generation is full and is displayed > correctly in console. However when I use a > java.io.FileWriter, the generated file does not > contain all data, and gets truncated after 32K. > //Works fine > StringWriter sw = new StringWriter(); > Velocity.mergeTemplate("velocityTemplate.vm","ISO-8859-1",context,sw); > System.out.println(sw); > > //Output truncated after 32K > File file = new > File("c:\velcoityOutput.txt"); > FileWriter fw = new FileWriter(file); > > Velocity.mergeTemplate("apptext.vm","ISO-8859-1",context,fw); > } Velocity or FileWriter classes don't have 32k limits, so must be something else. Try calling "fw.flush(); fw.close();" after merging a template and context. Good practise is to call flush even if you use StringWriter thus its not actually needed for it. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
