org.apache.commons.compress.archivers.ar
public class ArArchiveInputStream extends ArchiveInputStream
Modifier and Type | Field and Description |
---|---|
private boolean |
closed |
private ArArchiveEntry |
currentEntry |
private long |
entryOffset |
private java.io.InputStream |
input |
private byte[] |
namebuffer |
private long |
offset |
Constructor and Description |
---|
ArArchiveInputStream(java.io.InputStream pInput)
Constructs an Ar input stream with the referenced stream
|
Modifier and Type | Method and Description |
---|---|
private int |
asInt(byte[] input) |
private int |
asInt(byte[] input,
int base) |
private long |
asLong(byte[] input) |
void |
close() |
private java.lang.String |
getExtendedName(int offset)
Get an extended name from the GNU extended name buffer.
|
ArArchiveEntry |
getNextArEntry()
Returns the next AR entry in this stream.
|
ArchiveEntry |
getNextEntry()
Returns the next Archive Entry in this Stream.
|
static boolean |
matches(byte[] signature,
int length)
Checks if the signature matches ASCII "!
|
int |
read(byte[] b,
int off,
int len) |
canReadEntryData, count, count, getBytesRead, getCount, pushedBackBytes, read
private final java.io.InputStream input
private long offset
private boolean closed
private ArArchiveEntry currentEntry
private byte[] namebuffer
private long entryOffset
public ArArchiveInputStream(java.io.InputStream pInput)
pInput
- the ar input streampublic ArArchiveEntry getNextArEntry() throws java.io.IOException
java.io.IOException
- if the entry could not be readprivate java.lang.String getExtendedName(int offset) throws java.io.IOException
offset
- pointer to entry within the bufferjava.io.IOException
- if name not found or buffer not set upprivate long asLong(byte[] input)
private int asInt(byte[] input)
private int asInt(byte[] input, int base)
public ArchiveEntry getNextEntry() throws java.io.IOException
ArchiveInputStream
getNextEntry
in class ArchiveInputStream
null
if there are no more entriesjava.io.IOException
- if the next entry could not be readpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public static boolean matches(byte[] signature, int length)
signature
- the bytes to checklength
- the number of bytes to check