Class ArchiveStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public abstract class ArchiveStream
    extends java.io.InputStream
    implements java.io.Closeable
    An input stream of an archive. Can be used to retrieve each individual ArchiveEntry.
    The getNextEntry() method is used to reset the input stream ready for reading the data from the next entry.
    • Constructor Detail

      • ArchiveStream

        public ArchiveStream()
    • Method Detail

      • getNextEntry

        public ArchiveEntry getNextEntry()
                                  throws java.io.IOException
        Moves the pointer of the stream to the next ArchiveEntry and returns it.
        Returns:
        the next archive entry.
        Throws:
        java.io.IOException - propagated I/O exception
      • createNextEntry

        protected abstract ArchiveEntry createNextEntry()
                                                 throws java.io.IOException
        Abstract method to create the next ArchiveEntry for the ArchiveStream implementation.
        Returns:
        the next archive entry
        Throws:
        java.io.IOException - propagated I/O exception
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException
      • isClosed

        public boolean isClosed()
        Checks whether the current stream has been closed
        Returns:
        true if the stream has been closed