use of com.mucommander.commons.io.BoundedInputStream in project mucommander by mucommander.
the class ArArchiveFile method getEntryInputStream.
@Override
public InputStream getEntryInputStream(ArchiveEntry entry, ArchiveEntryIterator entryIterator) throws IOException, UnsupportedFileOperationException {
InputStream in = getInputStream();
ArchiveEntryIterator iterator = new ArArchiveEntryIterator(in);
ArchiveEntry currentEntry;
while ((currentEntry = iterator.nextEntry()) != null) {
if (currentEntry.getName().equals(entry.getName())) {
LOGGER.trace("found entry {}", entry.getName());
return new BoundedInputStream(in, entry.getSize(), false);
}
}
// Entry not found, should not normally happen
LOGGER.info("Warning: entry not found, throwing IOException");
throw new IOException();
}
Aggregations