Class jada.net.JadaNetIO
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jada.net.JadaNetIO

java.lang.Object
   |
   +----jada.net.JadaNetIO

public class JadaNetIO
extends Object
Utility class used to store/retrieve net connections parameters and read/write objects

Constructor Index

 o JadaNetIO(InputStream)
Construtor.
 o JadaNetIO(InputStream, OutputStream)
Construtor.
 o JadaNetIO(OutputStream)
Construtor.
 o JadaNetIO(Socket)
Construtor.
 o JadaNetIO(String, int)
Constructor.

Method Index

 o close()
Closes the actual connection.
 o finalize()
 o getInputStream()
Returns the actual DataInputStream object used.
 o getOutputStream()
Returns the actual DataOutputStream object used.
 o getSocket()
Returns the actual Socket object used.
 o read()
Reads a single byte from the input stream.
 o readObject()
Reads an object from the input stream.
 o write(int)
Writes a single byte into the output stream.
 o writeObject(Object)
Write a object into the output stream.

Constructors

 o JadaNetIO
  public JadaNetIO(String host,
                   int port) throws IOException
Constructor. tries to open a socket connection with the remote host (with retries attempts, if needed). If you do not have weird needs plase use this constructor: it's the only one that automatically reset the connection when a network trouble arises.
 o JadaNetIO
  public JadaNetIO(Socket s) throws IOException
Construtor. Initialize the object with the given Socket object.
 o JadaNetIO
  public JadaNetIO(OutputStream os)
Construtor. Initialize the object with the given OutputStream object. Use with care: the object is not fully set up and you can't use it for input requests!
 o JadaNetIO
  public JadaNetIO(InputStream is)
Construtor. Initialize the object with the given InputStream object. Use with care: the object is not fully set up and you can't use it for output requests!
 o JadaNetIO
  public JadaNetIO(InputStream is,
                   OutputStream os)
Construtor. Initialize the object with the given InputStream and OutputStream objects.

Methods

 o finalize
  protected void finalize() throws Throwable
Overrides:
finalize in class Object
 o close
  public synchronized void close() throws IOException
Closes the actual connection.
 o getSocket
  public synchronized Socket getSocket()
Returns the actual Socket object used.
 o getOutputStream
  public synchronized DataOutputStream getOutputStream()
Returns the actual DataOutputStream object used.
 o getInputStream
  public synchronized DataInputStream getInputStream()
Returns the actual DataInputStream object used.
 o write
  public synchronized void write(int val) throws IOException
Writes a single byte into the output stream.
 o read
  public synchronized int read() throws IOException
Reads a single byte from the input stream. If a EOF condition arises a IOException is thrown.
 o writeObject
  public synchronized void writeObject(Object object) throws JadaIOException
Write a object into the output stream. If the object is an instance of JadaItem use JadaItem's methods else tries using the serializers. If everything fails a JadaIOException exception is thrown.
 o readObject
  public synchronized Object readObject() throws JadaIOException
Reads an object from the input stream. The object must be dumped using this class Write method. Note also that the class file for the dumped object must be accessible and that the object must have a no-arg constructor!

All Packages  Class Hierarchy  This Package  Previous  Next  Index