@Override public long getSize() { return entry.getSize(); }
@Override public synchronized void add(long nbBytes) { entry.setSize(entry.getSize()+nbBytes); entry.setDate(System.currentTimeMillis()); } });
public ArchiveEntry nextEntry() throws IOException { if(currentEntry!=null) { // Skip the current entry's data, plus 1 padding byte if size is odd long size = currentEntry.getSize(); StreamUtils.skipFully(in, size + (size%2)); } // Get the next entry, if any currentEntry = getNextEntry(); return currentEntry; }
@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(); } }