@NotThreadSafe public class TarInputShop extends Object implements InputShop<TarDriverEntry>
Note that the constructor of this class extracts each entry in the archive to a temporary file. This may be very time and space consuming for large archives, but is the fastest implementation for subsequent random access, since there is no way the archive driver could predict the client application's behaviour.
TarOutputShop
Constructor and Description |
---|
TarInputShop(TarDriver driver,
InputStream in) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
TarDriverEntry |
getEntry(String name)
Returns the entry for the given
name or
null if no entry with this name exists in this container. |
InputSocket<TarDriverEntry> |
getInputSocket(String name)
Returns an input socket for reading from the entry with the given name.
|
int |
getSize()
Returns the number of entries in this container.
|
Iterator<TarDriverEntry> |
iterator()
Returns a new iterator for all entries in this container.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
@CreatesObligation public TarInputShop(TarDriver driver, @WillNotClose InputStream in) throws EOFException, IOException
EOFException
IOException
public void close() throws IOException
close
in interface InputShop<TarDriverEntry>
close
in interface Closeable
close
in interface AutoCloseable
IOException
@CheckForNull public final TarDriverEntry getEntry(String name)
EntryContainer
name
or
null
if no entry with this name exists in this container.getEntry
in interface EntryContainer<TarDriverEntry>
name
- an entry name.name
or
null
if no entry with this name exists in this container.public InputSocket<TarDriverEntry> getInputSocket(String name)
InputService
getInputSocket
in interface InputService<TarDriverEntry>
name
- an entry name
.public final int getSize()
EntryContainer
getSize
in interface EntryContainer<TarDriverEntry>
public final Iterator<TarDriverEntry> iterator()
InputService
First, the iteration must be consistent: Multiple iterators must iterate the same entries in the same order again unless the set of entries has changed.
Next, the iteration should also reflect the natural order of the entries in this container. For example, if this container represents an archive file, the iteration should reflect the natural order of the entries in the archive file.
The iterator returned by this method must be unmodifiable.
iterator
in interface EntryContainer<TarDriverEntry>
iterator
in interface InputService<TarDriverEntry>
iterator
in interface Iterable<TarDriverEntry>
Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.