AE - The type of the archive entries.@NotThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public class FsMultiplexedOutputShop<AE extends FsArchiveEntry> extends DecoratingOutputShop<AE,OutputShop<AE>>
OutputStream.close() method.
Note that this implies that the close() method may fail with
an IOException.| Modifier and Type | Class and Description |
|---|---|
private class |
FsMultiplexedOutputShop.BufferedEntriesIterator |
private class |
FsMultiplexedOutputShop.BufferedEntryOutputStream
This entry output stream writes the archive entry to an
I/O pool entry. |
private class |
FsMultiplexedOutputShop.EntryOutputStream
This entry output stream writes directly to this output shop.
|
| Modifier and Type | Field and Description |
|---|---|
private Map<String,FsMultiplexedOutputShop.BufferedEntryOutputStream> |
buffers
The map of temporary archive entries which have not yet been written
to the output archive.
|
private boolean |
busy |
private IOPool<?> |
pool |
delegate| Constructor and Description |
|---|
FsMultiplexedOutputShop(OutputShop<AE> output,
IOPool<?> pool)
Constructs a new multiplexed output shop.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
AE |
getEntry(String name)
Returns the entry for the given
name or
null if no entry with this name exists in this container. |
OutputSocket<? extends AE> |
getOutputSocket(AE entry)
Returns an output socket for writing to the given entry.
|
int |
getSize()
Returns the number of entries in this container.
|
boolean |
isBusy()
Returns whether the container output archive is busy writing an archive
entry or not.
|
Iterator<AE> |
iterator()
Returns a new iterator for all entries in this container.
|
private void |
storeBuffers() |
toStringprivate final Map<String,FsMultiplexedOutputShop.BufferedEntryOutputStream> buffers
private boolean busy
isBusy()private final IOPool<?> pool
public FsMultiplexedOutputShop(OutputShop<AE> output, IOPool<?> pool)
output - the decorated output shop.pool - the pool for buffering entry data.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class DecoratingOutputShop<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>IOException@CheckForNull public AE getEntry(String name)
EntryContainername or
null if no entry with this name exists in this container.getEntry in interface EntryContainer<AE extends FsArchiveEntry>getEntry in class DecoratingEntryContainer<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>name - an entry name.name or
null if no entry with this name exists in this container.public OutputSocket<? extends AE> getOutputSocket(AE entry)
OutputServicegetOutputSocket in interface OutputService<AE extends FsArchiveEntry>getOutputSocket in class DecoratingOutputShop<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>entry - the entry, which will be the
local target of the returned
output socket.public int getSize()
EntryContainergetSize in interface EntryContainer<AE extends FsArchiveEntry>getSize in class DecoratingEntryContainer<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>public boolean isBusy()
public Iterator<AE> iterator()
EntryContainerFirst, 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.
iterator in interface EntryContainer<AE extends FsArchiveEntry>iterator in interface Iterable<AE extends FsArchiveEntry>iterator in class DecoratingEntryContainer<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>private void storeBuffers()
throws IOException
IOExceptionCopyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.