NonClosingJarInputStream (Apache Tomcat 11.0.25 API Documentation)
Description: declaration: package: org.apache.tomcat.util.scan, class: NonClosingJarInputStream

# Class NonClosingJarInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.util.zip.InflaterInputStream
java.util.zip.ZipInputStream
java.util.jar.JarInputStream
org.apache.tomcat.util.scan.NonClosingJarInputStream

All Implemented Interfaces:
  `Closeable, AutoCloseable`

public class NonClosingJarInputStream extends JarInputStream
When using a `JarInputStream` with an XML parser, the stream will be closed by the parser. This causes problems if multiple entries from the JAR need to be parsed. This implementation makes {`close()` a NO-OP and adds `reallyClose()` that will close the stream.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `CENATT`
  `static final int`
  `CENATX`
  `static final int`
  `CENCOM`
  `static final int`
  `CENCRC`
  `static final int`
  `CENDSK`
  `static final int`
  `CENEXT`
  `static final int`
  `CENFLG`
  `static final int`
  `CENHDR`
  `static final int`
  `CENHOW`
  `static final int`
  `CENLEN`
  `static final int`
  `CENNAM`
  `static final int`
  `CENOFF`
  `static final long`
  `CENSIG`
  `static final int`
  `CENSIZ`
  `static final int`
  `CENTIM`
  `static final int`
  `CENVEM`
  `static final int`
  `CENVER`
  `static final int`
  `ENDCOM`
  `static final int`
  `ENDHDR`
  `static final int`
  `ENDOFF`
  `static final long`
  `ENDSIG`
  `static final int`
  `ENDSIZ`
  `static final int`
  `ENDSUB`
  `static final int`
  `ENDTOT`
  `static final int`
  `EXTCRC`
  `static final int`
  `EXTHDR`
  `static final int`
  `EXTLEN`
  `static final long`
  `EXTSIG`
  `static final int`
  `EXTSIZ`
  `static final int`
  `LOCCRC`
  `static final int`
  `LOCEXT`
  `static final int`
  `LOCFLG`
  `static final int`
  `LOCHDR`
  `static final int`
  `LOCHOW`
  `static final int`
  `LOCLEN`
  `static final int`
  `LOCNAM`
  `static final long`
  `LOCSIG`
  `static final int`
  `LOCSIZ`
  `static final int`
  `LOCTIM`
  `static final int`
  `LOCVER`

  ### Fields inherited from class InflaterInputStream

  `buf, inf, len`

  ### Fields inherited from class FilterInputStream

  `in`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NonClosingJarInputStream(InputStream in)`
  Constructs a NonClosingJarInputStream without verification.
  `NonClosingJarInputStream(InputStream in, boolean verify)`
  Constructs a NonClosingJarInputStream with verification.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `void`
  `reallyClose()`
  Actually closes the underlying stream.

  ### Methods inherited from class JarInputStream

  `createZipEntry, getManifest, getNextEntry, getNextJarEntry, read`

  ### Methods inherited from class ZipInputStream

  `available, closeEntry, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo`

  ### Methods inherited from class InflaterInputStream

  `fill, mark, markSupported, reset`

  ### Methods inherited from class FilterInputStream

  `read`

  ### Methods inherited from class InputStream

  `nullInputStream`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### LOCSIG

    static final long LOCSIG
    See Also:
      - Constant Field Values

  - ### EXTSIG

    static final long EXTSIG
    See Also:
      - Constant Field Values

  - ### CENSIG

    static final long CENSIG
    See Also:
      - Constant Field Values

  - ### ENDSIG

    static final long ENDSIG
    See Also:
      - Constant Field Values

  - ### LOCHDR

    static final int LOCHDR
    See Also:
      - Constant Field Values

  - ### EXTHDR

    static final int EXTHDR
    See Also:
      - Constant Field Values

  - ### CENHDR

    static final int CENHDR
    See Also:
      - Constant Field Values

  - ### ENDHDR

    static final int ENDHDR
    See Also:
      - Constant Field Values

  - ### LOCVER

    static final int LOCVER
    See Also:
      - Constant Field Values

  - ### LOCFLG

    static final int LOCFLG
    See Also:
      - Constant Field Values

  - ### LOCHOW

    static final int LOCHOW
    See Also:
      - Constant Field Values

  - ### LOCTIM

    static final int LOCTIM
    See Also:
      - Constant Field Values

  - ### LOCCRC

    static final int LOCCRC
    See Also:
      - Constant Field Values

  - ### LOCSIZ

    static final int LOCSIZ
    See Also:
      - Constant Field Values

  - ### LOCLEN

    static final int LOCLEN
    See Also:
      - Constant Field Values

  - ### LOCNAM

    static final int LOCNAM
    See Also:
      - Constant Field Values

  - ### LOCEXT

    static final int LOCEXT
    See Also:
      - Constant Field Values

  - ### EXTCRC

    static final int EXTCRC
    See Also:
      - Constant Field Values

  - ### EXTSIZ

    static final int EXTSIZ
    See Also:
      - Constant Field Values

  - ### EXTLEN

    static final int EXTLEN
    See Also:
      - Constant Field Values

  - ### CENVEM

    static final int CENVEM
    See Also:
      - Constant Field Values

  - ### CENVER

    static final int CENVER
    See Also:
      - Constant Field Values

  - ### CENFLG

    static final int CENFLG
    See Also:
      - Constant Field Values

  - ### CENHOW

    static final int CENHOW
    See Also:
      - Constant Field Values

  - ### CENTIM

    static final int CENTIM
    See Also:
      - Constant Field Values

  - ### CENCRC

    static final int CENCRC
    See Also:
      - Constant Field Values

  - ### CENSIZ

    static final int CENSIZ
    See Also:
      - Constant Field Values

  - ### CENLEN

    static final int CENLEN
    See Also:
      - Constant Field Values

  - ### CENNAM

    static final int CENNAM
    See Also:
      - Constant Field Values

  - ### CENEXT

    static final int CENEXT
    See Also:
      - Constant Field Values

  - ### CENCOM

    static final int CENCOM
    See Also:
      - Constant Field Values

  - ### CENDSK

    static final int CENDSK
    See Also:
      - Constant Field Values

  - ### CENATT

    static final int CENATT
    See Also:
      - Constant Field Values

  - ### CENATX

    static final int CENATX
    See Also:
      - Constant Field Values

  - ### CENOFF

    static final int CENOFF
    See Also:
      - Constant Field Values

  - ### ENDSUB

    static final int ENDSUB
    See Also:
      - Constant Field Values

  - ### ENDTOT

    static final int ENDTOT
    See Also:
      - Constant Field Values

  - ### ENDSIZ

    static final int ENDSIZ
    See Also:
      - Constant Field Values

  - ### ENDOFF

    static final int ENDOFF
    See Also:
      - Constant Field Values

  - ### ENDCOM

    static final int ENDCOM
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### NonClosingJarInputStream

    public NonClosingJarInputStream(InputStream in, boolean verify) throws IOException
    Constructs a NonClosingJarInputStream with verification.
    Parameters:
      `in` - The input stream to wrap
      `verify` - Whether to verify entries
    Throws:
      `IOException` - if an I/O error occurs

  - ### NonClosingJarInputStream

    public NonClosingJarInputStream(InputStream in) throws IOException
    Constructs a NonClosingJarInputStream without verification.
    Parameters:
      `in` - The input stream to wrap
    Throws:
      `IOException` - if an I/O error occurs

- ## Method Details

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Overrides:
      `close` in class `ZipInputStream`
    Throws:
      `IOException`

  - ### reallyClose

    public void reallyClose() throws IOException
    Actually closes the underlying stream.
    Throws:
      `IOException` - if an I/O error occurs