|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.truezip.socket.IOSocket<LT,PT>
LT - the type of the local target
for I/O operations.PT - the type of the peer target
for I/O operations.@ThreadSafe public abstract class IOSocket<LT,PT>
An abstract address of a target for I/O operations which is provided by sub class implementations.
A key feature of an I/O socket is that it's targets can be resolved lazily, i.e. the local or peer target may get resolved by a method of a sub class.
| Constructor Summary | |
|---|---|
IOSocket()
You cannot instantiate this class outside its package. |
|
| Method Summary | |
|---|---|
static void |
copy(InputSocket<?> input,
OutputSocket<?> output)
Copies an input stream created
by the given input socket input to an output stream
created by the given output socket
output. |
boolean |
equals(Object that)
Two sockets are considered equal if and only if they are identical. |
abstract LT |
getLocalTarget()
Returns the local target for I/O operations. |
abstract PT |
getPeerTarget()
Returns the peer target for I/O operations. |
int |
hashCode()
Returns a hash code which is consistent with equals(java.lang.Object). |
String |
toString()
Returns a string representing a connection of the local and peer targets. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
IOSocket()
| Method Detail |
|---|
@NonNull
public abstract LT getLocalTarget()
throws IOException
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.
IOException
@CheckForNull
public abstract PT getPeerTarget()
throws IOException
The same considerations as for getLocalTarget() apply here, too.
IOException
public static void copy(@NonNull
InputSocket<?> input,
@NonNull
OutputSocket<?> output)
throws IOException
created
by the given input socket input to an output stream
created by the given output socket
output.
input - an input socket for the input target.output - an output socket for the output target.
InputException - if copying the data fails because of an
IOException thrown by the input stream.
IOException - if copying the data fails because of an
IOException thrown by the output stream.
NullPointerException - if any parameter is null.@NonNull public String toString()
toString in class Object
public final boolean equals(@CheckForNull
Object that)
equals in class Objectpublic final int hashCode()
equals(java.lang.Object).
This can't get overriden.
hashCode in class Object
|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||