@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.
|
@CreatesObligation public TarInputShop(TarDriver driver, @WillNotClose InputStream in) throws EOFException, IOException
EOFExceptionIOExceptionpublic void close()
throws IOException
close in interface InputShop<TarDriverEntry>close in interface Closeableclose in interface AutoCloseableIOException@CheckForNull public final TarDriverEntry getEntry(String name)
EntryContainername 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)
InputServicegetInputSocket in interface InputService<TarDriverEntry>name - an entry name.public final int getSize()
EntryContainergetSize in interface EntryContainer<TarDriverEntry>public final Iterator<TarDriverEntry> iterator()
InputServiceFirst, 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-2013 Schlichtherle IT Services. All Rights Reserved.