Class ArArchiveInputStream
java.lang.Object
java.io.InputStream
org.apache.commons.compress.archivers.ArchiveInputStream
org.apache.commons.compress.archivers.ar.ArArchiveInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Implements the "ar" archive format as an input stream.
- This class is not thread-safe
-
Constructor Summary
ConstructorDescriptionArArchiveInputStream
(InputStream inputStream) Constructs an Ar input stream with the referenced stream -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Returns the next AR entry in this stream.Returns 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 characterint
read
(byte[] b, int off, int len) Methods inherited from class org.apache.commons.compress.archivers.ArchiveInputStream
canReadEntryData, count, count, getBytesRead, getCount, pushedBackBytes, read
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
-
Constructor Details
-
ArArchiveInputStream
Constructs an Ar input stream with the referenced stream- Parameters:
inputStream
- the ar input stream
-
-
Method Details
-
matches
Checks if the signature matches ASCII "!<arch>" followed by a single LF control character- Parameters:
signature
- the bytes to checklength
- the number of bytes to check- Returns:
- true, if this stream is an Ar archive stream, false otherwise
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
getNextArEntry
Returns the next AR entry in this stream.- Returns:
- the next AR entry.
- Throws:
IOException
- if the entry could not be read
-
getNextEntry
Description copied from class:ArchiveInputStream
Returns the next Archive Entry in this Stream.- Specified by:
getNextEntry
in classArchiveInputStream
- Returns:
- the next entry,
or
null
if there are no more entries - Throws:
IOException
- if the next entry could not be read
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-