Class ArjArchiveInputStream

    • Constructor Summary

      Constructors 
      Constructor Description
      ArjArchiveInputStream​(java.io.InputStream inputStream)
      Constructs the ArjInputStream, taking ownership of the inputStream that is passed in, and using the CP437 character encoding.
      ArjArchiveInputStream​(java.io.InputStream inputStream, java.lang.String charsetName)
      Constructs the ArjInputStream, taking ownership of the inputStream that is passed in.
    • Constructor Detail

      • ArjArchiveInputStream

        public ArjArchiveInputStream​(java.io.InputStream inputStream)
                              throws ArchiveException
        Constructs the ArjInputStream, taking ownership of the inputStream that is passed in, and using the CP437 character encoding.
        Parameters:
        inputStream - the underlying stream, whose ownership is taken
        Throws:
        ArchiveException - if an exception occurs while reading
      • ArjArchiveInputStream

        public ArjArchiveInputStream​(java.io.InputStream inputStream,
                                     java.lang.String charsetName)
                              throws ArchiveException
        Constructs the ArjInputStream, taking ownership of the inputStream that is passed in.
        Parameters:
        inputStream - the underlying stream, whose ownership is taken
        charsetName - the charset used for file names and comments in the archive. May be null to use the platform default.
        Throws:
        ArchiveException - if an exception occurs while reading
    • Method Detail

      • matches

        public static boolean matches​(byte[] signature,
                                      int length)
        Checks if the signature matches what is expected for an arj file.
        Parameters:
        signature - the bytes to check
        length - the number of bytes to check
        Returns:
        true, if this stream is an arj archive stream, false otherwise
      • canReadEntryData

        public boolean canReadEntryData​(ArchiveEntry ae)
        Description copied from class: ArchiveInputStream
        Whether this stream is able to read the given entry.

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

        Overrides:
        canReadEntryData in class ArchiveInputStream<ArjArchiveEntry>
        Parameters:
        ae - the entry to test
        Returns:
        This implementation always returns true.
      • 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
      • getArchiveComment

        public java.lang.String getArchiveComment()
        Gets the archive's comment.
        Returns:
        the archive's comment
      • getArchiveName

        public java.lang.String getArchiveName()
        Gets the archive's recorded name.
        Returns:
        the archive's name
      • 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