Java ZipEntry Read getNextZipEntry(ZipInputStream in)

Here you can find the source of getNextZipEntry(ZipInputStream in)

Description

Reads the next ZIP file entry from the ZipInputStream and positions the stream at the beginning of the entry data.

License

Open Source License

Parameter

Parameter Description
in the ZipInputStream to read from.

Return

a ZipEntry.

Declaration

public static ZipEntry getNextZipEntry(ZipInputStream in) 

Method Source Code

//package com.java2s;

import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

public class Main {
    /**//from  w  w  w.  j  a v a2s.  c  o m
     * Reads the next ZIP file entry from the ZipInputStream and positions the
     * stream at the beginning of the entry data.
     *
     * @param in the ZipInputStream to read from.
     * @return a ZipEntry.
     */
    public static ZipEntry getNextZipEntry(ZipInputStream in) {
        try {
            return in.getNextEntry();
        } catch (Exception ex) {
            throw new RuntimeException(
                    "Failed to get next entry in ZIP-file", ex);
        }
    }
}

Related

  1. getSimpleName(ZipEntry entry)
  2. getZipEntry(File f, String nameToRead, String fileName)
  3. getZipEntry(final ZipFile zipFile, final CharSequence zippedName)
  4. getZipEntry(String name, ZipFile zipFile)