Package net.lingala.zip4j.io.inputstream
Class ZipInputStream
- java.lang.Object
-
- java.io.InputStream
-
- net.lingala.zip4j.io.inputstream.ZipInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ZipInputStream extends InputStream
-
-
Constructor Summary
Constructors Constructor Description ZipInputStream(InputStream inputStream)ZipInputStream(InputStream inputStream, char[] password)ZipInputStream(InputStream inputStream, char[] password, Charset charset)ZipInputStream(InputStream inputStream, char[] password, Zip4jConfig zip4jConfig)ZipInputStream(InputStream inputStream, Charset charset)ZipInputStream(InputStream inputStream, PasswordCallback passwordCallback)ZipInputStream(InputStream inputStream, PasswordCallback passwordCallback, Charset charset)ZipInputStream(InputStream inputStream, PasswordCallback passwordCallback, Zip4jConfig zip4jConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()LocalFileHeadergetNextEntry()LocalFileHeadergetNextEntry(FileHeader fileHeader, boolean readUntilEndOfCurrentEntryIfOpen)intread()intread(byte[] b)intread(byte[] b, int off, int len)voidsetPassword(char[] password)Sets the password for the inputstream.-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
ZipInputStream
public ZipInputStream(InputStream inputStream)
-
ZipInputStream
public ZipInputStream(InputStream inputStream, Charset charset)
-
ZipInputStream
public ZipInputStream(InputStream inputStream, char[] password)
-
ZipInputStream
public ZipInputStream(InputStream inputStream, PasswordCallback passwordCallback)
-
ZipInputStream
public ZipInputStream(InputStream inputStream, char[] password, Charset charset)
-
ZipInputStream
public ZipInputStream(InputStream inputStream, PasswordCallback passwordCallback, Charset charset)
-
ZipInputStream
public ZipInputStream(InputStream inputStream, char[] password, Zip4jConfig zip4jConfig)
-
ZipInputStream
public ZipInputStream(InputStream inputStream, PasswordCallback passwordCallback, Zip4jConfig zip4jConfig)
-
-
Method Detail
-
getNextEntry
public LocalFileHeader getNextEntry() throws IOException
- Throws:
IOException
-
getNextEntry
public LocalFileHeader getNextEntry(FileHeader fileHeader, boolean readUntilEndOfCurrentEntryIfOpen) throws IOException
- Throws:
IOException
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
setPassword
public void setPassword(char[] password)
Sets the password for the inputstream. This password will be used for any subsequent encrypted entries that will be read from this stream. If this method is called when an entry is being read, it has no effect on the read action of the current entry, and the password will take effect from any subsequent entry reads.- Parameters:
password- Password to be used for reading of entries from the zip input stream
-
-