private final class IOCache.Input extends DelegatingInputSocket<Entry>
| Modifier and Type | Field and Description |
|---|---|
(package private) IOCache.Buffer |
buffer |
| Modifier | Constructor and Description |
|---|---|
private |
IOCache.Input() |
| Modifier and Type | Method and Description |
|---|---|
protected InputSocket<? extends Entry> |
getBoundSocket()
Binds the decorated socket to this socket and returns it.
|
protected InputSocket<? extends Entry> |
getDelegate()
Returns the delegate socket.
|
Entry |
getLocalTarget()
Returns the local target for I/O operations.
|
Entry |
getPeerTarget()
Returns the peer target for I/O operations.
|
InputStream |
newInputStream()
Returns a new input stream for reading bytes from the
local target. |
ReadOnlyFile |
newReadOnlyFile()
Optional: Returns a new read only file for reading bytes from
the
local target in arbitrary order. |
SeekableByteChannel |
newSeekableByteChannel()
Optional: Returns a new seekable byte channel for reading bytes
from the
local target in arbitrary order. |
toStringbind, connect@CheckForNull volatile IOCache.Buffer buffer
protected InputSocket<? extends Entry> getBoundSocket() throws IOException
DelegatingInputSocketgetBoundSocket in class DelegatingInputSocket<Entry>IOExceptionprotected InputSocket<? extends Entry> getDelegate() throws IOException
DelegatingInputSocketgetDelegate in class DelegatingInputSocket<Entry>IOExceptionpublic Entry 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 DelegatingInputSocket<Entry>IOExceptionpublic Entry getPeerTarget() throws IOException
InputSocket
The same considerations as for IOSocket.getLocalTarget() apply here, too.
The peer target is null if and only if this socket is not
InputSocket.connect(de.schlichtherle.truezip.socket.OutputSocket<?>)ed to another socket.
getPeerTarget in class DelegatingInputSocket<Entry>IOExceptionpublic InputStream newInputStream() throws IOException
InputSocketlocal target.
Implementations must enable calling this method any number of times.
Furthermore, the returned input 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<?>).
The implementation in the class InputSocket calls
InputSocket.newReadOnlyFile() and wraps the resulting object in a new
ReadOnlyFileInputStream as an adapter.
Note that this may violate the contract for this method because
InputSocket.newReadOnlyFile() is allowed to throw an
UnsupportedOperationException while this method is not!
newInputStream in class DelegatingInputSocket<Entry>IOException - on any I/O error.public ReadOnlyFile newReadOnlyFile() throws IOException
InputSocketlocal target in arbitrary order.
If this method is supported, implementations must enable calling it any number of times. Furthermore, the returned read only file should not be buffered. Buffering should be addressed by client applications instead.
newReadOnlyFile in class DelegatingInputSocket<Entry>IOException - on any I/O error.public SeekableByteChannel newSeekableByteChannel() throws IOException
InputSocketlocal 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 DelegatingInputSocket<Entry>IOException - on any I/O error.Copyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.