java.util.zip

Class ZipOutputStream

Implemented Interfaces:
Closeable, Flushable, java.util.zip.ZipConstants
Known Direct Subclasses:
JarOutputStream

public class ZipOutputStream
extends DeflaterOutputStream
implements java.util.zip.ZipConstants

This class implements an output stream filter for writing files in the ZIP file format. Includes support for both compressed and uncompressed entries.

Field Summary

static int
DEFLATED
Compression method for compressed (DEFLATED) entries.
static int
STORED
Compression method for uncompressed (STORED) entries.

Fields inherited from class java.util.zip.DeflaterOutputStream

buf, def

Fields inherited from class java.io.FilterOutputStream

out

Fields inherited from interface java.util.zip.ZipConstants

CENATT, CENATX, CENCOM, CENCRC, CENDSK, CENEXT, CENFLG, CENHDR, CENHOW, CENLEN, CENNAM, CENOFF, CENSIG, CENSIZ, CENTIM, CENVEM, CENVER, ENDCOM, ENDHDR, ENDOFF, ENDSIG, ENDSIZ, ENDSUB, ENDTOT, EXTCRC, EXTHDR, EXTLEN, EXTSIG, EXTSIZ, LOCCRC, LOCEXT, LOCFLG, LOCHDR, LOCHOW, LOCLEN, LOCNAM, LOCSIG, LOCSIZ, LOCTIM, LOCVER

Constructor Summary

ZipOutputStream(OutputStream out)
Creates a new ZIP output stream.

Method Summary

void
close()
Closes the ZIP output stream as well as the stream being filtered.
void
closeEntry()
Closes the current ZIP entry and positions the stream for writing the next entry.
void
finish()
Finishes writing the contents of the ZIP output stream without closing the underlying stream.
void
putNextEntry(ZipEntry e)
Begins writing a new ZIP file entry and positions the stream to the start of the entry data.
void
setComment(String comment)
Sets the ZIP file comment.
void
setLevel(int level)
Sets the compression level for subsequent entries which are DEFLATED.
void
setMethod(int method)
Sets the default compression method for subsequent entries.
void
write(byte[] b, int off, int len)
Writes an array of bytes to the current ZIP entry data.

Methods inherited from class java.util.zip.DeflaterOutputStream

close, deflate, finish, write, write

Methods inherited from class java.io.FilterOutputStream

close, flush, write, write, write

Methods inherited from class java.io.OutputStream

close, flush, write, write, write

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

DEFLATED

public static final int DEFLATED
Compression method for compressed (DEFLATED) entries.
Field Value:
8
Usages and Demos :

View More Examples of ZipOutputStream.DEFLATED
   1:         zip_stream.setLevel(9);
   2:         zip_stream.setMethod(ZipOutputStream.DEFLATED);
   3:         ZipEntry tsv_zip = new ZipEntry(tsv_filename);
   4:         try
   5:         {

View Full Code Here
   1:                 this.outputStream = new ZipOutputStream(new FileOutputStream(this.zipFile));
   2:                 this.outputStream.setMethod(ZipOutputStream.DEFLATED);
   3:                 this.outputStream.setLevel(9);
   4:                 this.addTextContent();
   5:                 this.addBinaryContent(this.content);

View Full Code Here
   1:         ZipOutputStream zip = new ZipOutputStream(out);
   2:         zip.setMethod(ZipOutputStream.DEFLATED);
   3:         zip.setLevel(Deflater.BEST_COMPRESSION);
   4:         zip.setComment("compiere");
   5:         byte[] deflatedData = null;

View Full Code Here
   1:             ServletOutputStream out = response.getOutputStream ();
   2:             zip.setMethod(ZipOutputStream.DEFLATED);
   3:             zip.setLevel(Deflater.BEST_COMPRESSION);
   4:             zip.setComment(readme);
   5:                             

View Full Code Here

STORED

public static final int STORED
Compression method for uncompressed (STORED) entries.
Field Value:
0
Usages and Demos :

View More Examples of ZipOutputStream.STORED
   1:       {
   2:         storageMode = ZipOutputStream.STORED;
   3:       }
   4:     });
   5:     {

View Full Code Here
   1:             out.setLevel(0);
   2:             out.setMethod(ZipOutputStream.STORED);
   3:             checkDirValid(sourcePath);
   4:             boolean isJnlpFile = true;
   5:             while (it.hasNext()) {

View Full Code Here
   1:             } else {
   2:                 zOut.setMethod(ZipOutputStream.STORED);
   3:             }
   4:             initZipOutputStream(zOut);
   5:             writeDirs(zOut, dirs);

View Full Code Here
   1:         } else {
   2:             output.setMethod(ZipOutputStream.STORED);
   3:         }
   4: 
   5:         Enumeration merges = mergefiles.elements();

View Full Code Here
   1:             pack_out = zip_out = new ZipOutputStream(compress_out);
   2:             zip_out.setMethod(ZipOutputStream.STORED);
   3:             zip_out.setComment("jose Database Archive");
   4:             break;
   5:         case PACK_ZIP:

View Full Code Here

Constructor Details

ZipOutputStream

public ZipOutputStream(OutputStream out)
Creates a new ZIP output stream.
Parameters:
out - the actual output stream
Usages and Demos :

View More Examples of ZipOutputStream(OutputStream out)
   1:                   
   2:                   ZipOutputStream zout = new ZipOutputStream(fout);
   3:                   
   4:                   zout.setLevel(level);
   5:                   

View Full Code Here
   1:         outStream = new ByteArrayOutputStream();
   2:         zipStream = new ZipOutputStream(outStream);
   3:         entries = new HashSet();
   4:         logger = Category.getInstance(getClass());
   5:     }

View Full Code Here
   1:     public ZipCodeWriter( OutputStream target ) {
   2:         zip = new ZipOutputStream(target);
   3:         filter = new FilterOutputStream(zip){
   4:             public void close() {}
   5:         };

View Full Code Here
   1:         case ZIP:
   2:             ZipOutputStream zout = new ZipOutputStream(out);
   3:             zout.putNextEntry(new ZipEntry("image"));
   4:             writeData(data,zout);
   5:             zout.finish();

View Full Code Here
   1:         ByteArrayOutputStream out = new ByteArrayOutputStream();
   2:         ZipOutputStream zip = new ZipOutputStream(out);
   3:         
   4:         try {
   5:             zip.putNextEntry(new ZipEntry(a_description));

View Full Code Here

Method Details

close

public void close()
            throws IOException
Closes the ZIP output stream as well as the stream being filtered.
Specified by:
close in interface Closeable
Overrides:
close in interface DeflaterOutputStream
Throws:
IOException - if an I/O error has occurred
Usages and Demos :

View More Examples of close()
   1:                   
   2:                   ZipOutputStream zout = new ZipOutputStream(fout);
   3:                   
   4:         ...
   5:                           zout.closeEntry();
   6:                           fin.close();
   7:                     }
   8:         ...
   9:                   }
  10:                   zout.close();    
  11:             }

View Full Code Here
   1: import java.util.zip.ZipInputStream;
   2: import java.util.zip.ZipOutputStream;
   3: 
   4:         ...
   5:     private ByteArrayOutputStream outStream;
   6:     private ZipOutputStream zipStream;
   7:     private Set entries;
   8:         ...
   9:         outStream = new ByteArrayOutputStream();
  10:         zipStream = new ZipOutputStream(outStream);
  11:         entries = new HashSet();
  12:         ...
  13:         zipStream.flush();
  14:         zipStream.close();

View Full Code Here
   1:         soubor, new Adler32());
   2:     ZipOutputStream vystup =
   3:         ...
   4:       new ZipOutputStream(
   5:         new BufferedOutputStream(kSoucet));
   6:         ...
   7:         vystup.write(cislo);
   8:       vstup.close();
   9:     }
  10:         ...
  11:     vystup.close();

View Full Code Here
   1: import java.io.*;
   2: import java.util.zip.ZipOutputStream;
   3: import java.util.zip.ZipEntry;
   4:         ...
   5:         FileOutputStream fout = new FileOutputStream(zipFile);
   6:         ZipOutputStream zout = null;
   7:         try {
   8:         ...
   9:             zout = new ZipOutputStream(new BufferedOutputStream(fout));
  10:             zout.setLevel(compressionLevel);
  11:         ...
  12:             if (zout != null)
  13:                 zout.close();

View Full Code Here
   1:         ByteArrayOutputStream out = new ByteArrayOutputStream();
   2:         ZipOutputStream zip = new ZipOutputStream(out);
   3:         
   4:         ...
   5:             zip.closeEntry();
   6:             zip.close();    
   7:         }
   8:         catch (IOException ioe) {
   9:             ioe.printStackTrace();            

View Full Code Here

closeEntry

public void closeEntry()
            throws IOException
Closes the current ZIP entry and positions the stream for writing the next entry.
Throws:
IOException - if an I/O error has occurred
Usages and Demos :

View More Examples of closeEntry()
   1:                   
   2:                   ZipOutputStream zout = new ZipOutputStream(fout);
   3:                   
   4:         ...
   5:                            
   6:                           zout.closeEntry();
   7:                           fin.close();
   8:                     }
   9:                     catch (IOException e) 

View Full Code Here
   1: import java.util.zip.ZipInputStream;
   2: import java.util.zip.ZipOutputStream;
   3: 
   4:         ...
   5:     private ByteArrayOutputStream outStream;
   6:     private ZipOutputStream zipStream;
   7:     private Set entries;
   8:         ...
   9:         outStream = new ByteArrayOutputStream();
  10:         zipStream = new ZipOutputStream(outStream);
  11:         entries = new HashSet();
  12:         ...
  13:         zipStream.write(content);
  14:         zipStream.closeEntry();

View Full Code Here
   1: import java.io.*;
   2: import java.util.zip.ZipOutputStream;
   3: import java.util.zip.ZipEntry;
   4:         ...
   5:         FileOutputStream fout = new FileOutputStream(zipFile);
   6:         ZipOutputStream zout = null;
   7:         try {
   8:         ...
   9:             zout = new ZipOutputStream(new BufferedOutputStream(fout));
  10:             zout.setLevel(compressionLevel);
  11:         ...
  12:             zout.putNextEntry(new ZipEntry(entryName + "/"));
  13:             zout.closeEntry();

View Full Code Here
   1:         ByteArrayOutputStream out = new ByteArrayOutputStream();
   2:         ZipOutputStream zip = new ZipOutputStream(out);
   3:         
   4:         ...
   5:             zip.write(a_data);
   6:             zip.closeEntry();
   7:             zip.close();    
   8:         }
   9:         catch (IOException ioe) {

View Full Code Here
   1: import java.io.IOException;
   2: import java.util.zip.ZipOutputStream;
   3: import java.util.zip.ZipEntry;
   4:         ...
   5:             os = context.getBookInstance().getResourceOutputStream(publicationOutputPath + zipFileName);
   6:             ZipOutputStream zos = new ZipOutputStream(os);
   7:             for (int i = 0; i < paths.length; i++) {
   8:         ...
   9:                 is.close();
  10:                 zos.closeEntry();
  11:             }

View Full Code Here

finish

public void finish()
            throws IOException
Finishes writing the contents of the ZIP output stream without closing the underlying stream. Use this method when applying multiple filters in succession to the same output stream.
Overrides:
finish in interface DeflaterOutputStream
Throws:
IOException - if an I/O exception has occurred
Usages and Demos :

View More Examples of finish()
   1:             writeData(data,gout);
   2:             gout.finish();
   3:             break;
   4:         ...
   5:         case ZIP:
   6:             ZipOutputStream zout = new ZipOutputStream(out);
   7:             zout.putNextEntry(new ZipEntry("image"));
   8:         ...
   9:             writeData(data,zout);
  10:             zout.finish();
  11:             break;

View Full Code Here
   1: import java.io.IOException;
   2: import java.util.zip.ZipOutputStream;
   3: import java.util.zip.ZipEntry;
   4:         ...
   5:             os = context.getBookInstance().getResourceOutputStream(publicationOutputPath + zipFileName);
   6:             ZipOutputStream zos = new ZipOutputStream(os);
   7:             for (int i = 0; i < paths.length; i++) {
   8:         ...
   9:             }
  10:             zos.finish();
  11:             zos.flush();

View Full Code Here
   1: import java.util.logging.Logger;
   2: import java.util.zip.ZipOutputStream;
   3: 
   4:         ...
   5:     public void writeTo(OutputStream out) throws ServiceException, IOException {
   6:         final ZipOutputStream outZ = new ZipOutputStream(out);
   7:         kmlEncoder.encodeKMZ(outZ);
   8:         ...
   9:         outZ.finish();
  10:         outZ.flush();

View Full Code Here
   1: public class ScormPackageBuilder {
   2:     ZipOutputStream zip = null;
   3:     boolean status = true;
   4:         ...
   5:         try {
   6:             zip = new ZipOutputStream(new FileOutputStream(zipName));
   7:             putXSDSchema();
   8:         ...
   9:         if (status) {
  10:             zip.finish();
  11:             zip.close();

View Full Code Here
   1:     private OutputStream    currentParentOutputStream;
   2:     private ZipOutputStream currentJarOutputStream;
   3:     private Finisher        currentFinisher;
   4:         ...
   5:                 new JarOutputStream(parentOutputStream, manifest) :
   6:                 new ZipOutputStream(parentOutputStream);
   7: 
   8:         ...
   9: 
  10:             currentJarOutputStream.finish();
  11:             currentJarOutputStream    = null;
  12:         ...
  13:             {
  14:                 currentFinisher.finish();

View Full Code Here

putNextEntry

public void putNextEntry(ZipEntry e)
            throws IOException
Begins writing a new ZIP file entry and positions the stream to the start of the entry data. Closes the current entry if still active. The default compression method will be used if no compression method was specified for the entry, and the current time will be used if the entry has no set modification time.
Parameters:
e - the ZIP entry to be written
Throws:
IOException - if an I/O error has occurred
Usages and Demos :

View More Examples of putNextEntry(ZipEntry e)
   1: import java.util.zip.ZipEntry;
   2: import java.util.zip.ZipOutputStream;
   3: 
   4:         ...
   5: public class ZipWriterHandler implements ClassFileHandler {
   6:     private ZipOutputStream zout;
   7:     private ByteArrayOutputStream bout;
   8:         ...
   9: 
  10:     public ZipWriterHandler(ZipOutputStream zout){
  11:         this.zout = zout;
  12:         ...
  13:             ZipEntry entry = new ZipEntry(cf.getClassName().replace('.', '/') + ".class");
  14:             zout.putNextEntry(entry);

View Full Code Here
   1:                   
   2:                   ZipOutputStream zout = new ZipOutputStream(fout);
   3:                   
   4:         ...
   5:                           FileInputStream fin = new FileInputStream(args[i]);
   6:                           zout.putNextEntry(ze);
   7:                           
   8:                           int c=-1;
   9:                           while ((c = fin.read()) != -1)

View Full Code Here
   1: import java.util.zip.ZipInputStream;
   2: import java.util.zip.ZipOutputStream;
   3: 
   4:         ...
   5:     private ByteArrayOutputStream outStream;
   6:     private ZipOutputStream zipStream;
   7:     private Set entries;
   8:         ...
   9:         outStream = new ByteArrayOutputStream();
  10:         zipStream = new ZipOutputStream(outStream);
  11:         entries = new HashSet();
  12:         ...
  13:         ZipEntry entry = new ZipEntry(entryName);
  14:         zipStream.putNextEntry(entry);

View Full Code Here
   1: import java.io.IOException;
   2: import java.util.zip.ZipOutputStream;
   3: import java.util.zip.ZipEntry;
   4:         ...
   5:             os = context.getBookInstance().getResourceOutputStream(publicationOutputPath + zipFileName);
   6:             ZipOutputStream zos = new ZipOutputStream(os);
   7:             for (int i = 0; i < paths.length; i++) {
   8:         ...
   9:                 ZipEntry zipEntry = new ZipEntry(name);
  10:                 zos.putNextEntry(zipEntry);
  11:                 is = bookInstance.getResource(paths[i]);

View Full Code Here
   1: 
   2:       ZipOutputStream myZipFile = new ZipOutputStream(
   3:                                         new FileOutputStream(myPrimeZip));
   4:         ...
   5:       ZipEntry myZipEntry = new ZipEntry(fileName); 
   6:       myZipFile.putNextEntry(myZipEntry);
   7: 
   8:       DataOutputStream myFile = new DataOutputStream(
   9:                                 new BufferedOutputStream(myZipFile));

View Full Code Here

setComment

public void setComment(String comment)
Sets the ZIP file comment.
Parameters:
comment - the comment string
Throws:
IllegalArgumentException - if the length of the specified ZIP file comment is greater than 0xFFFF bytes
Usages and Demos :

View More Examples of setComment(String comment)
   1:     private OutputStream    currentParentOutputStream;
   2:     private ZipOutputStream currentJarOutputStream;
   3:     private Finisher        currentFinisher;
   4:         ...
   5:                 new JarOutputStream(parentOutputStream, manifest) :
   6:                 new ZipOutputStream(parentOutputStream);
   7: 
   8:         ...
   9:             {
  10:                 currentJarOutputStream.setComment(comment);
  11:             }

View Full Code Here
   1:         ByteArrayOutputStream out = new ByteArrayOutputStream(); 
   2:         ZipOutputStream zip = new ZipOutputStream(out);
   3:         ...
   4:         zip.setMethod(ZipOutputStream.DEFLATED);
   5:         zip.setLevel(Deflater.BEST_COMPRESSION);
   6:         ...
   7:         zip.setComment("compiere");
   8:         byte[] deflatedData = null;

View Full Code Here
   1:             ServletOutputStream out = response.getOutputStream ();
   2:             zip.setMethod(ZipOutputStream.DEFLATED);
   3:             zip.setLevel(Deflater.BEST_COMPRESSION);
   4:         ...
   5:             zip.setComment(readme);
   6:                             
   7:             ZipEntry entry = new ZipEntry("readme.txt");
   8:             entry.setExtra(assetInfo);

View Full Code Here
   1:         try {                        
   2:             ZipOutputStream out = new ZipOutputStream(new FileOutputStream(targetFile));
   3:                         
   4:         ...
   5:             
   6:             out.setComment(getCommentForZip());
   7:             out.close();
   8:         }catch(Exception e){
   9:             e.printStackTrace();

View Full Code Here
   1:         ByteArrayOutputStream out = new ByteArrayOutputStream(); 
   2:         ZipOutputStream zip = new ZipOutputStream(out);
   3:         ...
   4:         zip.setMethod(ZipOutputStream.DEFLATED);
   5:         zip.setLevel(Deflater.BEST_COMPRESSION);
   6:         ...
   7:         zip.setComment("compiere");
   8:         try

View Full Code Here

setLevel

public void setLevel(int level)
Sets the compression level for subsequent entries which are DEFLATED. The default setting is DEFAULT_COMPRESSION.
Parameters:
level - the compression level (0-9)
Throws:
IllegalArgumentException - if the compression level is invalid
Usages and Demos :

View More Examples of setLevel(int level)
   1:                   
   2:                   ZipOutputStream zout = new ZipOutputStream(fout);
   3:                   
   4:         ...
   5:                   zout.setLevel(level);
   6:                   
   7:                   for (int i = start; i < args.length; i++) 
   8:                   {

View Full Code Here
   1: import java.io.*;
   2: import java.util.zip.ZipOutputStream;
   3: import java.util.zip.ZipEntry;
   4:         ...
   5:         FileOutputStream fout = new FileOutputStream(zipFile);
   6:         ZipOutputStream zout = null;
   7:         try {
   8:         ...
   9:             zout = new ZipOutputStream(new BufferedOutputStream(fout));
  10:         ...
  11:             zout.setLevel(compressionLevel);

View Full Code Here
   1: import java.util.zip.ZipEntry;
   2: import java.util.zip.ZipOutputStream;
   3: 
   4:         ...
   5:         OutputStream binary_out = getOutputStream();
   6:         ZipOutputStream zip_stream = new ZipOutputStream(getOutputStream());
   7:         ...
   8:         zip_stream.setLevel(9);
   9:         zip_stream.setMethod(ZipOutputStream.DEFLATED);

View Full Code Here
   1: import java.util.zip.Deflater;
   2: import java.util.zip.ZipOutputStream;
   3: import java.util.zip.ZipEntry;
   4:         ...
   5:         FileOutputStream fout = new FileOutputStream(zipFile);
   6:         ZipOutputStream zout = null;
   7:         try {
   8:         ...
   9:             zout = new ZipOutputStream(new BufferedOutputStream(fout));
  10:         ...
  11:             zout.setLevel(compressionLevel);

View Full Code Here
   1: import java.util.zip.ZipEntry;
   2: import java.util.zip.ZipOutputStream;
   3: 
   4:         ...
   5:       ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
   6:       ZipOutputStream zipStream = new ZipOutputStream(byteStream);
   7:         ...
   8:       zipStream.setLevel(Deflater.BEST_SPEED);
   9:       

View Full Code Here

setMethod

public void setMethod(int method)
Sets the default compression method for subsequent entries. This default will be used whenever the compression method is not specified for an individual ZIP file entry, and is initially set to DEFLATED.
Parameters:
method - the default compression method
Throws:
IllegalArgumentException - if the specified compression method is invalid
Usages and Demos :

View More Examples of setMethod(int method)
   1: import java.util.zip.ZipEntry;
   2: import java.util.zip.ZipOutputStream;
   3: 
   4:         ...
   5:         OutputStream binary_out = getOutputStream();
   6:         ZipOutputStream zip_stream = new ZipOutputStream(getOutputStream());
   7:         zip_stream.setLevel(9);
   8:         ...
   9:         zip_stream.setMethod(ZipOutputStream.DEFLATED);
  10:         ZipEntry tsv_zip = new ZipEntry(tsv_filename);

View Full Code Here
   1: import java.util.zip.ZipInputStream;
   2: import java.util.zip.ZipOutputStream;
   3: 
   4:         ...
   5:                                 f.createNewFile();
   6:                         ZipOutputStream zipos = new ZipOutputStream(new FileOutputStream(f));
   7:                         DataOutputStream os = new DataOutputStream(zipos);
   8:                 }
   9:                 catch (IOException ioe) {

View Full Code Here
   1:         ByteArrayOutputStream out = new ByteArrayOutputStream(); 
   2:         ZipOutputStream zip = new ZipOutputStream(out);
   3:         ...
   4:         zip.setMethod(ZipOutputStream.DEFLATED);
   5:         zip.setLevel(Deflater.BEST_COMPRESSION);
   6:         ...
   7:             entry.setTime(System.currentTimeMillis());
   8:             entry.setMethod(ZipEntry.DEFLATED);
   9:             zip.putNextEntry(entry);

View Full Code Here
   1:             ServletOutputStream out = response.getOutputStream ();
   2:             zip.setMethod(ZipOutputStream.DEFLATED);
   3:             zip.setLevel(Deflater.BEST_COMPRESSION);
   4:             zip.setComment(readme);
   5:                             

View Full Code Here
   1: import java.util.zip.CheckedInputStream;
   2: import java.util.zip.ZipOutputStream;
   3: import java.util.zip.ZipEntry;
   4:         ...
   5:                                    String oneFilePath,
   6:                                    ZipOutputStream out) throws IOException  {
   7:         try {
   8:         ...
   9:             ZipEntry entry = new ZipEntry(oneFileName);
  10:             entry.setMethod(ZipEntry.STORED);
  11:             entry.setSize(bytes);
  12:         ...
  13:                                                     new CRC32());
  14:             ZipOutputStream out = new ZipOutputStream(

View Full Code Here

write

public void write(byte[] b,
                  int off,
                  int len)
            throws IOException
Writes an array of bytes to the current ZIP entry data. This method will block until all the bytes are written.
Overrides:
write in interface DeflaterOutputStream
Parameters:
b - the data to be written
off - the start offset in the data
len - the number of bytes that are written
Throws:
IOException - if an I/O error has occurred
Usages and Demos :

View More Examples of write(byte[] b,int off,int len)
   1: import java.util.zip.ZipFile;
   2: import java.util.zip.ZipOutputStream;
   3: 
   4:         ...
   5:             ZipFile zf = new ZipFile(f);
   6:             ZipOutputStream out = new ZipOutputStream(new FileOutputStream(g));
   7:             Enumeration e = zf.entries();
   8:         ...
   9:                     if (n != -1) {
  10:                         out.write(buf, 0, n);
  11:                     }

View Full Code Here
   1: import java.util.zip.ZipEntry;
   2: import java.util.zip.ZipOutputStream;
   3: 
   4:         ...
   5:     
   6:     protected void writeFileToZip(ZipOutputStream out, File file, String zipEntryName){
   7:         byte[] buf = new byte[4096];
   8:         ...
   9:             while ((len = in.read(buf)) > 0) {
  10:               out.write(buf, 0, len);
  11:             }

View Full Code Here
   1: import java.util.zip.ZipInputStream;
   2: import java.util.zip.ZipOutputStream;
   3: 
   4:         ...
   5:             while ((bytesRead = zin.read(buffer, 0, 8192)) != -1) {
   6:                 outputStream.write(buffer, 0, bytesRead);
   7:             }
   8:         ...
   9:         try {
  10:             ZipOutputStream zout = new ZipOutputStream(new FileOutputStream(filename));
  11: 
  12:         ...
  13:             while ((bytesRead = inputStream.read(buffer, 0, 8192)) != -1) {
  14:                 zout.write(buffer, 0, bytesRead);

View Full Code Here
   1:     
   2:         ZipOutputStream out =
   3:         ...
   4:         new ZipOutputStream(new FileOutputStream(zipfile));
   5:     
   6:         ...
   7:             File f = new File(d, entries[i]);
   8:                 out.write(buffer, 0, bytes_read);
   9:         }

View Full Code Here
   1:     
   2:         ZipOutputStream out =
   3:         ...
   4:         new ZipOutputStream(new FileOutputStream(zipfile));
   5:     
   6:         ...
   7:             File f = new File(d, entries[i]);
   8:                 out.write(buffer, 0, bytes_read);
   9:         }

View Full Code Here