Package org.dspace.content.packager
Class PackageUtils.UnclosableInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.dspace.content.packager.PackageUtils.UnclosableInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
- PackageUtils
public static class PackageUtils.UnclosableInputStream extends FilterInputStream
Stream wrapper that does not allow its wrapped stream to be closed. This is needed to work around problem when loading bitstreams from ZipInputStream. The Bitstream constructor invokes close() on the input stream, which would prematurely end the ZipInputStream. Example:ZipEntry ze = zip.getNextEntry(); Bitstream bs = bundle.createBitstream(new PackageUtils.UnclosableInputStream(zipInput));
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description UnclosableInputStream(InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Do nothing, to prevent wrapped stream from being closed prematurely.-
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, read, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
UnclosableInputStream
public UnclosableInputStream(InputStream in)
-
-
Method Detail
-
close
public void close()
Do nothing, to prevent wrapped stream from being closed prematurely.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterInputStream
-
-