|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.net.Socket
com.liviutudor.rmi.io.gzip.GzipSocket
class GzipSocket
Socket which uses gzip to compress the data sent over the wire.
| Field Summary | |
|---|---|
private GZIPInputStream |
inputStream
Wrapper for the socket input stream. |
private GZIPOutputStream |
outputStream
Wrapper for the socket output stream. |
| Constructor Summary | |
|---|---|
GzipSocket(String host,
int port)
Creates a socket which connects to the given host on the given port. |
|
| Method Summary | |
|---|---|
void |
close()
|
InputStream |
getInputStream()
Overrides the base class method for returning the input stream for this socket and returns instead the gzip-based wrapper. |
OutputStream |
getOutputStream()
Overrides the base class method for returning the output stream for this socket and returns instead the gzip-based wrapper. |
void |
shutdownInput()
|
void |
shutdownOutput()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private GZIPInputStream inputStream
private GZIPOutputStream outputStream
| Constructor Detail |
|---|
public GzipSocket(String host,
int port)
throws UnknownHostException,
IOException
host - Host to connect toport - Port to connect to
UnknownHostException - if host name or IP is wrong
IOException - if I/O errors occur when connecting| Method Detail |
|---|
public void close()
throws IOException
close in class SocketIOException
public InputStream getInputStream()
throws IOException
gzip-based wrapper.
Note that this is a lazy evaluation function. NOTE: The GzipInputStream
blocks on creation to read the header so this function actually blocks
until data is available over the wire!
getInputStream in class SocketIOException - if I/O errors occurinputStream
public OutputStream getOutputStream()
throws IOException
gzip-based wrapper.
getOutputStream in class SocketIOException - if I/O errors occuroutputStream
public void shutdownInput()
throws IOException
shutdownInput in class SocketIOException
public void shutdownOutput()
throws IOException
shutdownOutput in class SocketIOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||