Class ArArchiveInputStream

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

    public class ArArchiveInputStream
    extends ArchiveInputStream<ArArchiveEntry>
    Implements the "ar" archive format as an input stream.
    • Constructor Detail

      • ArArchiveInputStream

        public ArArchiveInputStream​(java.io.InputStream inputStream)
        Constructs an Ar input stream with the referenced stream
        Parameters:
        inputStream - the ar input stream
    • Method Detail

      • matches

        public static boolean matches​(byte[] signature,
                                      int length)
        Checks if the signature matches ASCII "!<arch>" followed by a single LF control character
        Parameters:
        signature - the bytes to check
        length - the number of bytes to check
        Returns:
        true, if this stream is an Ar archive stream, false otherwise
      • 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.FilterInputStream
        Throws:
        java.io.IOException
      • getNextArEntry

        @Deprecated
        public ArArchiveEntry getNextArEntry()
                                      throws java.io.IOException
        Deprecated.
        Returns the next AR entry in this stream.
        Returns:
        the next AR entry.
        Throws:
        java.io.IOException - if the entry could not be read
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException