AE - The type of the archive entries.@NotThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public class FsMultiplexedArchiveOutputShop<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 |
FsMultiplexedArchiveOutputShop.BufferedEntriesIterator |
private class |
FsMultiplexedArchiveOutputShop.BufferedEntryOutputStream
This entry output stream writes the archive entry to an
I/O pool entry. |
private class |
FsMultiplexedArchiveOutputShop.EntryOutputStream
This entry output stream writes directly to this output shop.
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,FsMultiplexedArchiveOutputShop.BufferedEntryOutputStream> |
buffers
The map of temporary archive entries which have not yet been written
to the output output archive.
|
private boolean |
busy |
private IOPool<?> |
pool |
delegate| Constructor and Description |
|---|
FsMultiplexedArchiveOutputShop(OutputShop<AE> output,
IOPool<?> pool)
Constructs a new
FsMultiplexedArchiveOutputShop. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
AE |
getEntry(java.lang.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.
|
java.util.Iterator<AE> |
iterator()
Returns a new iterator for all entries in this container.
|
private void |
storeBuffers() |
toStringprivate final IOPool<?> pool
private final java.util.Map<java.lang.String,FsMultiplexedArchiveOutputShop.BufferedEntryOutputStream> buffers
private boolean busy
isBusy()public FsMultiplexedArchiveOutputShop(OutputShop<AE> output, IOPool<?> pool)
FsMultiplexedArchiveOutputShop.output - the decorated output archive.java.lang.NullPointerException - if any parameter is null.public int getSize()
EntryContainergetSize in interface EntryContainer<AE extends FsArchiveEntry>getSize in class DecoratingEntryContainer<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>public java.util.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 java.lang.Iterable<AE extends FsArchiveEntry>iterator in class DecoratingEntryContainer<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>@CheckForNull public AE getEntry(java.lang.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 boolean isBusy()
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class DecoratingOutputShop<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>java.io.IOExceptionprivate void storeBuffers()
throws java.io.IOException
java.io.IOExceptionCopyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.