com.myJava.file.archive.zip64
Class ZipInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.myJava.file.archive.zip64.InflaterInputStream
com.myJava.file.archive.zip64.ZipInputStream
- All Implemented Interfaces:
- ZipConstants, java.io.Closeable
public class ZipInputStream
- extends InflaterInputStream
- implements ZipConstants
This class implements an input stream filter for reading files in the
ZIP file format. Includes support for both compressed and uncompressed
entries.
- Version:
- 1.33, 02/07/03
This class was derived from the original java.util.zip.ZipInputStream.
The following modifications were made :
- This new class reads zip32 and zip64 archives but IGNORES file size written in local entry headers. (these data are read from the EXT area)
- Package change
- Only DEFLATED files are handled
- Multivolumes support
- Buffer size parameterization
- Author:
- David Connelly, Olivier Petrucci
CAUTION :
This file has been integrated into Areca.
It is has also possibly been adapted to meet Areca's needs. If such modifications has been made, they are described above.
Thanks to the authors for their work.
Areca Build ID : 7299034069467778562
Fields inherited from class java.io.FilterInputStream |
in |
Fields inherited from interface com.myJava.file.archive.zip64.ZipConstants |
CENATT, CENATX, CENCOM, CENCRC, CENDSK, CENEXT, CENFLG, CENHDR, CENHOW, CENLEN, CENNAM, CENOFF, CENSIG, CENSIZ, CENTIM, CENVEM, CENVER, DEFAULT_CHARSET, ENDCOM, ENDHDR, ENDOFF, ENDSIG, ENDSIZ, ENDSUB, ENDTOT, EXTCRC, EXTHDR, EXTHDR64, EXTLEN, EXTLEN64, EXTSIG, EXTSIZ, LOCCRC, LOCEXT, LOCFLG, LOCHDR, LOCHOW, LOCLEN, LOCNAM, LOCSIG, LOCSIZ, LOCTIM, LOCVER, MAX_INT, MVSIG, SIZE_INT, SIZE_LONG, SIZE_SHORT, ZIP64ENDLENGTH, ZIP64ENDLOCSIG, ZIP64ENDSIG, ZIP64SIZEFLAG, ZIP64VERSION, ZIP64XTRAFIELD, ZIP64XTRALENGTH, ZIPVERSION |
Method Summary |
int |
available()
Returns 0 after EOF has reached, otherwise always return 1. |
void |
close()
Closes the input stream. |
void |
closeEntry()
|
protected ZipEntry |
createZipEntry(java.lang.String name)
|
java.nio.charset.Charset |
getCharset()
|
ZipEntry |
getNextEntry()
|
int |
read(byte[] b,
int off,
int len)
Reads uncompressed data into an array of bytes. |
void |
setCharset(java.nio.charset.Charset charset)
|
long |
skip(long n)
Skips specified number of bytes of uncompressed data. |
Methods inherited from class java.io.FilterInputStream |
mark, markSupported, read, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZipInputStream
public ZipInputStream(java.io.InputStream in)
getNextEntry
public ZipEntry getNextEntry()
throws java.io.IOException
- Throws:
java.io.IOException
closeEntry
public void closeEntry()
throws java.io.IOException
- Throws:
java.io.IOException
available
public int available()
throws java.io.IOException
- Description copied from class:
InflaterInputStream
- Returns 0 after EOF has reached, otherwise always return 1.
Programs should not count on this method to return the actual number
of bytes that could be read without blocking.
- Overrides:
available
in class InflaterInputStream
- Returns:
- 1 before EOF and 0 after EOF.
- Throws:
java.io.IOException
- if an I/O error occurs.
getCharset
public java.nio.charset.Charset getCharset()
setCharset
public void setCharset(java.nio.charset.Charset charset)
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Description copied from class:
InflaterInputStream
- Reads uncompressed data into an array of bytes. This method will
block until some input can be decompressed.
- Overrides:
read
in class InflaterInputStream
- Parameters:
b
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes read
- Returns:
- the actual number of bytes read, or -1 if the end of the
compressed input is reached or a preset dictionary is needed
- Throws:
java.util.zip.ZipException
- if a ZIP format error has occurred
java.io.IOException
- if an I/O error has occurred
skip
public long skip(long n)
throws java.io.IOException
- Description copied from class:
InflaterInputStream
- Skips specified number of bytes of uncompressed data.
- Overrides:
skip
in class InflaterInputStream
- Parameters:
n
- the number of bytes to skip
- Returns:
- the actual number of bytes skipped.
- Throws:
java.io.IOException
- if an I/O error has occurred
close
public void close()
throws java.io.IOException
- Description copied from class:
InflaterInputStream
- Closes the input stream.
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class InflaterInputStream
- Throws:
java.io.IOException
- if an I/O error has occurred
createZipEntry
protected ZipEntry createZipEntry(java.lang.String name)