Package org.apache.commons.compress.archivers.ar

# Class ArArchiveInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.commons.compress.archivers.ArchiveInputStream<ArArchiveEntry>
org.apache.commons.compress.archivers.ar.ArArchiveInputStream

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

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

This class is not thread-safe

- ## Field Summary

  ### Fields inherited from class java.io.FilterInputStream

  `in`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ArArchiveInputStream(InputStream inputStream)`
  Constructs an Ar input stream with the referenced stream

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `ArArchiveEntry`
  `getNextArEntry()`
  Deprecated.
  Use `getNextEntry()`.
  `ArArchiveEntry`
  `getNextEntry()`
  Gets the next Archive Entry in this Stream.
  `static boolean`
  `matches(byte[] signature, int length)`
  Checks if the signature matches ASCII "!<arch>" followed by a single LF control character
  `int`
  `read(byte[] b, int off, int len)`

  ### Methods inherited from class org.apache.commons.compress.archivers.ArchiveInputStream

  `canReadEntryData, count, count, getBytesRead, getCharset, getCount, pushedBackBytes, read`

  ### Methods inherited from class java.io.FilterInputStream

  `available, mark, markSupported, read, reset, skip`

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### ArArchiveInputStream

    public ArArchiveInputStream(InputStream inputStream)
    Constructs an Ar input stream with the referenced stream
    Parameters:
      `inputStream` - the ar input stream

- ## Method Details

  - ### 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 IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Overrides:
      `close` in class `FilterInputStream`
    Throws:
      `IOException`

  - ### getNextArEntry

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

  - ### getNextEntry

    public ArArchiveEntry getNextEntry() throws IOException
    Description copied from class: `ArchiveInputStream`
    Gets the next Archive Entry in this Stream.
    Specified by:
      `getNextEntry` in class `ArchiveInputStream<ArArchiveEntry>`
    Returns:
      the next entry, or `null` if there are no more entries
    Throws:
      `IOException` - if the next entry could not be read

  - ### read

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