Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Java Zip File

StringBuilder sb = new StringBuilder();
sb.append("Test String");

File f = new File("d:	est.zip");
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(f));
ZipEntry e = new ZipEntry("mytext.txt");
out.putNextEntry(e);

byte[] data = sb.toString().getBytes();
out.write(data, 0, data.length);
out.closeEntry();

out.close();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Java #Zip #File
ADD COMMENT
Topic
Name
6+8 =