Class MCRNotClosingInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.mycore.common.content.streams.MCRNotClosingInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class MCRNotClosingInputStream extends FilterInputStream
A FilterInputStream that wraps any InputStream to prevent close() is called. Sometimes, third party code or code you can not change closes an InputStream after it returned -1 on read(). But when using ZipInputStream, this is unwanted, because a ZipInputStream may contain other entries that have to be read and invoked code must be prevented from calling close(). With this class, a ZipInputStream or any other stream can be wrapped to regain control of closing.
Author:
Frank Lützenkirchen