Package net.lingala.zip4j.io.inputstream
Class CipherInputStream<T extends Decrypter>
- java.lang.Object
-
- java.io.InputStream
-
- net.lingala.zip4j.io.inputstream.CipherInputStream<T>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
AesCipherInputStream,NoCipherInputStream,ZipStandardCipherInputStream
abstract class CipherInputStream<T extends Decrypter> extends java.io.InputStream
-
-
Field Summary
Fields Modifier and Type Field Description private Tdecrypterprivate byte[]lastReadRawDataCacheprivate LocalFileHeaderlocalFileHeaderprivate byte[]singleByteBufferprivate ZipEntryInputStreamzipEntryInputStream
-
Constructor Summary
Constructors Constructor Description CipherInputStream(ZipEntryInputStream zipEntryInputStream, LocalFileHeader localFileHeader, char[] password, int bufferSize, boolean useUtf8ForPassword)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private voidcacheRawData(byte[] b, int len)voidclose()protected voidendOfEntryReached(java.io.InputStream inputStream, int numberOfBytesPushedBack)TgetDecrypter()byte[]getLastReadRawDataCache()LocalFileHeadergetLocalFileHeader()protected longgetNumberOfBytesReadForThisEntry()protected abstract TinitializeDecrypter(LocalFileHeader localFileHeader, char[] password, boolean useUtf8ForPassword)intread()intread(byte[] b)intread(byte[] b, int off, int len)protected intreadRaw(byte[] b)
-
-
-
Field Detail
-
zipEntryInputStream
private ZipEntryInputStream zipEntryInputStream
-
lastReadRawDataCache
private byte[] lastReadRawDataCache
-
singleByteBuffer
private byte[] singleByteBuffer
-
localFileHeader
private LocalFileHeader localFileHeader
-
-
Constructor Detail
-
CipherInputStream
public CipherInputStream(ZipEntryInputStream zipEntryInputStream, LocalFileHeader localFileHeader, char[] password, int bufferSize, boolean useUtf8ForPassword) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
getLastReadRawDataCache
public byte[] getLastReadRawDataCache()
-
readRaw
protected int readRaw(byte[] b) throws java.io.IOException- Throws:
java.io.IOException
-
cacheRawData
private void cacheRawData(byte[] b, int len)
-
getDecrypter
public T getDecrypter()
-
endOfEntryReached
protected void endOfEntryReached(java.io.InputStream inputStream, int numberOfBytesPushedBack) throws java.io.IOException- Throws:
java.io.IOException
-
getNumberOfBytesReadForThisEntry
protected long getNumberOfBytesReadForThisEntry()
-
getLocalFileHeader
public LocalFileHeader getLocalFileHeader()
-
initializeDecrypter
protected abstract T initializeDecrypter(LocalFileHeader localFileHeader, char[] password, boolean useUtf8ForPassword) throws java.io.IOException
- Throws:
java.io.IOException
-
-