Class 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));