Package com.wavemaker.commons.zip
Class DynamicZipInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.wavemaker.commons.zip.DynamicZipInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class DynamicZipInputStream extends java.io.InputStreamInputStream that dynamically creates ZIP contents as the stream is read without consuming too much memory. Zipentriesshould be provided onconstruction.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDynamicZipInputStream.EntryRepresents a single entry from a ZIP files.
-
Constructor Summary
Constructors Constructor Description DynamicZipInputStream(java.lang.Iterable<DynamicZipInputStream.Entry> entries)Create a newDynamicZipInputStreaminstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()intread()intread(byte[] b, int off, int len)protected booleanwriteMoreData()
-
-
-
Constructor Detail
-
DynamicZipInputStream
public DynamicZipInputStream(java.lang.Iterable<DynamicZipInputStream.Entry> entries)
Create a newDynamicZipInputStreaminstance.- Parameters:
entries- the zip entries that should be written to the stream
-
-
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, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
writeMoreData
protected boolean writeMoreData() throws java.io.IOException- 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
-
-