Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

outputting zip file  RSS feed

 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ....
i am new to file IO ... and
i want to output zip file containg one or more xml files in zip through servet

i am creating multiple JDOM Document objects and i need to put all files into ZIP ..

ServletOutputStream outX = res.getOutputStream();

// outX.write(); this method takes bytes as input i dont know how should i input my JDOM object to this method

anyidea ??

thanks
Ravi
 
olivier dutranoit
Ranch Hand
Posts: 81
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for creating zips, try using

import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

 
The glass is neither half full or half empty. It is too big. But this tiny ad is just right:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!