IT. Expert System.

Android Reference

ZipOutputStream


java.util.zip

Class ZipOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable
    Direct Known Subclasses:
    JarOutputStream


    public class ZipOutputStream
    extends DeflaterOutputStream
    This class provides an implementation of FilterOutputStream that compresses data entries into a ZIP-archive output stream.

    ZipOutputStream is used to write ZipEntries to the underlying stream. Output from ZipOutputStream conforms to the ZipFile file format.

    While DeflaterOutputStream can write a compressed ZIP-archive entry, this extension can write uncompressed entries as well. In this case special rules apply, for this purpose refer to the file format specification.

    Example

    Using ZipOutputStream is a little more complicated than GZIPOutputStream because ZIP archives are containers that can contain multiple files. This code creates a ZIP archive containing several files, similar to the zip(1) utility.

     OutputStream os = ...
     ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(os));
     try {
         for (int i = 0; i < filecount; ++i) {
             string filename = ...
             byte[] bytes = ...
             zipentry entry = new zipentry(filename);
             zos.putnextentry(entry);
             zos.write(bytes);
             zos.closeentry();
         }
     } finally {
         zos.close();
     }
     
    See Also:
    ZipEntry, ZipFile


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 2619 / . Delta: 0.01828 с