|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.net.Socket
org.tentackle.net.SocketWrapper
org.tentackle.net.CompressedSocketWrapper
public class CompressedSocketWrapper
A compressed socket wrapper on top of another socket, usually an SSL-socket.
| Constructor Summary | |
|---|---|
CompressedSocketWrapper(Socket socket)
Creates a compressed socket wrapper. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this socket. |
InputStream |
getInputStream()
Returns an input stream for this socket. |
OutputStream |
getOutputStream()
Returns an output stream for this socket. |
| Methods inherited from class org.tentackle.net.SocketWrapper |
|---|
bind, connect, equals, getChannel, hashCode, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CompressedSocketWrapper(Socket socket)
throws SocketException
socket - the wrapped socket (for example a SSLSocket).
SocketException| Method Detail |
|---|
public InputStream getInputStream()
throws IOException
java.net.Socket If this socket has an associated channel then the resulting input
stream delegates all of its operations to the channel. If the channel
is in non-blocking mode then the input stream's read operations
will throw an IllegalBlockingModeException.
Under abnormal conditions the underlying connection may be broken by the remote host or the network software (for example a connection reset in the case of TCP connections). When a broken connection is detected by the network software the following applies to the returned input stream :-
The network software may discard bytes that are buffered
by the socket. Bytes that aren't discarded by the network
software can be read using read.
If there are no bytes buffered on the socket, or all
buffered bytes have been consumed by
read, then all subsequent
calls to read will throw an
IOException.
If there are no bytes buffered on the socket, and the
socket has not been closed using close, then
available will
return 0.
Closing the returned InputStream
will close the associated socket.
getInputStream in class SocketIOException - if an I/O error occurs when creating the
input stream, the socket is closed, the socket is
not connected, or the socket input has been shutdown
using Socket.shutdownInput()
public OutputStream getOutputStream()
throws IOException
java.net.Socket If this socket has an associated channel then the resulting output
stream delegates all of its operations to the channel. If the channel
is in non-blocking mode then the output stream's write
operations will throw an IllegalBlockingModeException.
Closing the returned OutputStream
will close the associated socket.
getOutputStream in class SocketIOException - if an I/O error occurs when creating the
output stream or if the socket is not connected.
public void close()
throws IOException
java.net.Socket
Any thread currently blocked in an I/O operation upon this socket
will throw a SocketException.
Once a socket has been closed, it is not available for further networking use (i.e. can't be reconnected or rebound). A new socket needs to be created.
Closing this socket will also close the socket's
InputStream and
OutputStream.
If this socket has an associated channel then the channel is closed as well.
close in class SocketWrapperIOException - if an I/O error occurs when closing this socket.Socket.isClosed()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||