Package 

Class ArchiveInputStream

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

    
    public abstract class ArchiveInputStream
    extends InputStream
                        

    Archive input streams MUST override the read - or read - method so that reading from the stream generates EOF for the end of data in each entry as well as at the end of the file proper.

    The getNextEntry method is used to reset the input stream ready for reading the data from the next entry.

    The input stream classes must also implement a method with the signature:

    public static boolean matches(byte[] signature, int length)
    
    which is used by the ArchiveStreamFactory to autodetect the archive type from the first few bytes of a stream.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long bytesRead
    • Method Summary

      Modifier and Type Method Description
      long getBytesRead() Returns the current number of bytes read from this stream.
      boolean canReadEntryData(ArchiveEntry archiveEntry) Whether this stream is able to read the given entry.
      int getCount() Returns the current number of bytes read from this stream.
      abstract ArchiveEntry getNextEntry() Returns the next Archive Entry in this Stream.
      int read() Reads a byte of data.
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getBytesRead

         long getBytesRead()

        Returns the current number of bytes read from this stream.

      • canReadEntryData

         boolean canReadEntryData(ArchiveEntry archiveEntry)

        Whether this stream is able to read the given entry.

        Some archive formats support variants or details that are not supported (yet).

        Parameters:
        archiveEntry - the entry to test
      • getCount

        @Deprecated() int getCount()

        Returns the current number of bytes read from this stream.

      • read

         int read()

        Reads a byte of data. This method will block until enough input isavailable.Simply calls the read method.MUST be overridden if the read methodis not overridden; may be overridden otherwise.