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));
 
  • Constructor Details

    • UnclosableInputStream

      public UnclosableInputStream(InputStream in)
  • Method Details