public interface StreamAccessor
extends java.lang.AutoCloseable
TransportLayer
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.io.InputStream |
getInputStream()
Returns the input stream for this stream accessor.
|
java.io.OutputStream |
getOutpuStream()
Returns the output stream for this stream accessor.
|
void |
setTimeout(int timeout)
Enable/disable TIMEOUT with the specified timeout, in milliseconds.
|
void setTimeout(int timeout) throws java.io.IOException
InputStream
m associated with this StreamAcessor will block for only this amount of
time. If the timeout expires, a java.net.SocketTimeoutException is raised, though the Socket is still valid. The
option must be enabled prior to entering the blocking operation to have effect. The timeout must be
> 0
. A timeout of zero is interpreted as an infinite timeout.timeout
- the specified timeout, in milliseconds.java.io.IOException
- if there is an error in the underlying protocol, such as a TCP error.java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
- an I/O error accessing the input stream, the stream accessor is closed, the stream accessor is not
connected.java.io.OutputStream getOutpuStream() throws java.io.IOException
java.io.IOException
- an I/O error accessing the output stream, the stream accessor is closed, the stream accessor is not
connected.void close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
java.io.IOException