Class ZipOnDemandInputStream
java.lang.Object
java.io.InputStream
org.jboss.shrinkwrap.impl.base.exporter.AbstractOnDemandInputStream<ZipOutputStream>
org.jboss.shrinkwrap.impl.base.exporter.zip.ZipOnDemandInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
ZIP on demand input stream.
-
Field Summary
FieldsFields inherited from class org.jboss.shrinkwrap.impl.base.exporter.AbstractOnDemandInputStream
outputStream -
Constructor Summary
ConstructorsConstructorDescriptionZipOnDemandInputStream(Archive<?> archive) Creates stream directly from archive with compression.ZipOnDemandInputStream(Archive<?> archive, boolean compressed) Creates stream directly from archive. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcloseEntry(ZipOutputStream outputStream) Closes the current entry context for the specifiedOutputStream.protected ZipOutputStreamcreateOutputStream(OutputStream outputStream) Creates the realOutputStreamto which we'll write, wrapping the provided target.protected voidputNextEntry(ZipOutputStream outputStream, String context, Asset asset) Writes the next entry (demarcates a new file/folder is to be written).Methods inherited from class org.jboss.shrinkwrap.impl.base.exporter.AbstractOnDemandInputStream
readMethods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
compressed
private boolean compressed -
SYSTIME
private static long SYSTIME
-
-
Constructor Details
-
ZipOnDemandInputStream
ZipOnDemandInputStream(Archive<?> archive) Creates stream directly from archive with compression.- Parameters:
archive-
-
ZipOnDemandInputStream
ZipOnDemandInputStream(Archive<?> archive, boolean compressed) Creates stream directly from archive.- Parameters:
archive-compressed-
-
-
Method Details
-
createOutputStream
Description copied from class:AbstractOnDemandInputStreamCreates the realOutputStreamto which we'll write, wrapping the provided target.- Specified by:
createOutputStreamin classAbstractOnDemandInputStream<ZipOutputStream>- Returns:
-
closeEntry
Description copied from class:AbstractOnDemandInputStreamCloses the current entry context for the specifiedOutputStream.- Specified by:
closeEntryin classAbstractOnDemandInputStream<ZipOutputStream>- Throws:
IOException
-
putNextEntry
protected void putNextEntry(ZipOutputStream outputStream, String context, Asset asset) throws IOException Description copied from class:AbstractOnDemandInputStreamWrites the next entry (demarcates a new file/folder is to be written).- Specified by:
putNextEntryin classAbstractOnDemandInputStream<ZipOutputStream>- Throws:
IOException- If an error occurred writing the entry
-