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:
Closeable
,AutoCloseable
- Direct Known Subclasses:
AesCipherInputStream
,NoCipherInputStream
,ZipStandardCipherInputStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate T
private byte[]
private LocalFileHeader
private byte[]
private ZipEntryInputStream
-
Constructor Summary
ConstructorsConstructorDescriptionCipherInputStream
(ZipEntryInputStream zipEntryInputStream, LocalFileHeader localFileHeader, char[] password, int bufferSize, boolean useUtf8ForPassword) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
cacheRawData
(byte[] b, int len) void
close()
protected void
endOfEntryReached
(InputStream inputStream, int numberOfBytesPushedBack) byte[]
protected long
protected abstract T
initializeDecrypter
(LocalFileHeader localFileHeader, char[] password, boolean useUtf8ForPassword) int
read()
int
read
(byte[] b) int
read
(byte[] b, int off, int len) protected int
readRaw
(byte[] b) Methods inherited from class java.io.InputStream
available, mark, markSupported, reset, skip
-
Field Details
-
zipEntryInputStream
-
decrypter
-
lastReadRawDataCache
private byte[] lastReadRawDataCache -
singleByteBuffer
private byte[] singleByteBuffer -
localFileHeader
-
-
Constructor Details
-
CipherInputStream
public CipherInputStream(ZipEntryInputStream zipEntryInputStream, LocalFileHeader localFileHeader, char[] password, int bufferSize, boolean useUtf8ForPassword) throws IOException - Throws:
IOException
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
getLastReadRawDataCache
public byte[] getLastReadRawDataCache() -
readRaw
- Throws:
IOException
-
cacheRawData
private void cacheRawData(byte[] b, int len) -
getDecrypter
-
endOfEntryReached
protected void endOfEntryReached(InputStream inputStream, int numberOfBytesPushedBack) throws IOException - Throws:
IOException
-
getNumberOfBytesReadForThisEntry
protected long getNumberOfBytesReadForThisEntry() -
getLocalFileHeader
-
initializeDecrypter
protected abstract T initializeDecrypter(LocalFileHeader localFileHeader, char[] password, boolean useUtf8ForPassword) throws IOException - Throws:
IOException
-