
org.zeroturnaround.zip.CloseShieldInputStream Maven / Gradle / Ivy
Go to download
The project is intended to have a small, easy and fast library to process ZIP archives. Either create, modify or explode them. On disk or in memory.
package org.zeroturnaround.zip;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipInputStream;
/**
* Filter stream that prevents the underlying input stream from being closed.
*
* It's a simpler version than org.apache.commons.io.input.CloseShieldInputStream
as it doesn't replace the underlying stream.
* It's only meant for internal use where we can close a {@link ZipInputStream} without closing the underlying stream itself.
*
*/
class CloseShieldInputStream extends FilterInputStream {
/**
* Creates a FilterInputStream
* by assigning the argument in
* to the field this.in
so as
* to remember it for later use.
*
* @param in the underlying input stream, or null
if
* this instance is to be created without an underlying stream.
*/
public CloseShieldInputStream(InputStream in) {
super(in);
}
@Override
public void close() throws IOException {
// do nothing
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy