E
- the type of the local target
.@NotThreadSafe public abstract class ClutchOutputSocket<E extends Entry> extends DelegatingOutputSocket<E>
ClutchInputSocket
Constructor and Description |
---|
ClutchOutputSocket() |
Modifier and Type | Method and Description |
---|---|
protected OutputSocket<? extends E> |
getDelegate()
Returns the delegate socket.
|
protected abstract OutputSocket<? extends E> |
getLazyDelegate()
Returns the delegate socket for lazy initialization.
|
E |
getLocalTarget()
Returns the local target for I/O operations.
|
OutputStream |
newOutputStream()
Returns a new output stream for writing bytes to the
local target . |
SeekableByteChannel |
newSeekableByteChannel()
Optional: Returns a new seekable byte channel for writing bytes
to the
local target in arbitrary order. |
protected void |
reset() |
getBoundSocket
bind, getPeerTarget
protected final OutputSocket<? extends E> getDelegate() throws IOException
DelegatingOutputSocket
getDelegate
in class DelegatingOutputSocket<E extends Entry>
IOException
- On any I/O failure.protected abstract OutputSocket<? extends E> getLazyDelegate() throws IOException
IOException
- on any I/O failure.public E getLocalTarget() throws IOException
IOSocket
Note that this interface contract does not state any other
terms or conditions for the returned object.
In particular, clients need to consider that multiple invocations of
this method could return different objects (e.g. defensive copies) which
may even fail the Object.equals(java.lang.Object)
test.
On the other hand, implementations need to consider that clients could
attempt to change the state of the returned object in arbitrary manner.
Consequently, the result of doing so is undefined, too.
In particular, a subsequent I/O operation may not reflect the change
or may even fail.
Sub-interfaces or implementations may add additional terms and
conditions in order to resolve these potential issues.
getLocalTarget
in class DelegatingOutputSocket<E extends Entry>
IOException
- On any I/O failure.public OutputStream newOutputStream() throws IOException
OutputSocket
local target
.
Implementations must enable calling this method any number of times.
Furthermore, the returned output stream should not be buffered.
Buffering should be addressed by the caller instead - see
IOSocket.copy(de.schlichtherle.truezip.socket.InputSocket<?>, de.schlichtherle.truezip.socket.OutputSocket<?>)
.
newOutputStream
in class DelegatingOutputSocket<E extends Entry>
IOException
- On any I/O failure.public SeekableByteChannel newSeekableByteChannel() throws IOException
OutputSocket
local target
in arbitrary order.
If this method is supported, implementations must enable calling it any number of times. Furthermore, the returned seekable byte channel should not be buffered. Buffering should be addressed by client applications instead.
newSeekableByteChannel
in class DelegatingOutputSocket<E extends Entry>
IOException
- On any I/O failure.protected final void reset()
Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.