org.vrspace.util
Class GZipConnection

java.lang.Object
  extended byjava.util.Observable
      extended byorg.vrspace.util.Connection
          extended byorg.vrspace.util.BinaryConnection
              extended byorg.vrspace.util.GZipConnection
All Implemented Interfaces:
java.lang.Runnable

public class GZipConnection
extends BinaryConnection

BinaryConnection that transfers GZIP comppressed data Not tested, probably does not work :)


Field Summary
 
Fields inherited from class org.vrspace.util.Connection
active, host, in, inQueue, login, maxTries, out, outQueue, password, port, reader, reconnect, socket, TERMINATOR, tries, writer
 
Constructor Summary
GZipConnection()
           
GZipConnection(java.lang.String host, int port, java.lang.String login, java.lang.String password)
          Creates new GZipConnection to host:port and loggs in as login with password
GZipConnection(java.lang.String hostPort, java.lang.String login, java.lang.String password)
          Creates new GZipConnection to hostPort and loggs in as login with password, assuming that hostPort is "host:port" pair
 
Method Summary
 java.io.OutputStream getOutputStream()
          Returns the network output stream
 void run()
          Interface java.lang.Runnable - reading from network
 void write(byte[] b)
          Sends byte array to the network
 void write(byte[] b, int offset, int len)
          Sends subset of byte array to the network
 
Methods inherited from class org.vrspace.util.Connection
addObserver, close, getHostName, getHostPort, getLogin, isActive, login, login, login, quit, read, reconnect, send, setLogin, setMaxTries, write
 
Methods inherited from class java.util.Observable
clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GZipConnection

public GZipConnection()

GZipConnection

public GZipConnection(java.lang.String host,
                      int port,
                      java.lang.String login,
                      java.lang.String password)
               throws ConnectionException,
                      java.io.IOException
Creates new GZipConnection to host:port and loggs in as login with password

Throws:
ConnectionException - if login fails
java.io.IOException

GZipConnection

public GZipConnection(java.lang.String hostPort,
                      java.lang.String login,
                      java.lang.String password)
               throws ConnectionException,
                      java.io.IOException
Creates new GZipConnection to hostPort and loggs in as login with password, assuming that hostPort is "host:port" pair

Throws:
ConnectionException - if login fails
java.io.IOException
Method Detail

getOutputStream

public java.io.OutputStream getOutputStream()
Returns the network output stream

Overrides:
getOutputStream in class BinaryConnection

write

public void write(byte[] b)
           throws java.io.IOException
Sends byte array to the network

Overrides:
write in class BinaryConnection
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int offset,
                  int len)
           throws java.io.IOException
Sends subset of byte array to the network

Overrides:
write in class BinaryConnection
Throws:
java.io.IOException

run

public void run()
Interface java.lang.Runnable - reading from network

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class BinaryConnection