org.dspace.content.packager
Class PackageUtils.UnclosableInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by org.dspace.content.packager.PackageUtils.UnclosableInputStream
All Implemented Interfaces:
Closeable
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
PackageUtils.UnclosableInputStream(InputStream in)
           
 
Method Summary
 void close()
          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.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PackageUtils.UnclosableInputStream

public PackageUtils.UnclosableInputStream(InputStream in)
Method Detail

close

public void close()
Do nothing, to prevent wrapped stream from being closed prematurely.

Specified by:
close in interface Closeable
Overrides:
close in class FilterInputStream


Copyright © 2010 DuraSpace. All Rights Reserved.