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
-
JadaNetIO(InputStream)
- Construtor.
-
JadaNetIO(InputStream, OutputStream)
- Construtor.
-
JadaNetIO(OutputStream)
- Construtor.
-
JadaNetIO(Socket)
- Construtor.
-
JadaNetIO(String, int)
- Constructor.
-
close()
- Closes the actual connection.
-
finalize()
-
-
getInputStream()
- Returns the actual DataInputStream object used.
-
getOutputStream()
- Returns the actual DataOutputStream object used.
-
getSocket()
- Returns the actual Socket object used.
-
read()
- Reads a single byte from the input stream.
-
readObject()
- Reads an object from the input stream.
-
write(int)
- Writes a single byte into the output stream.
-
writeObject(Object)
- Write a object into the output stream.
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.
JadaNetIO
public JadaNetIO(Socket s) throws IOException
- Construtor. Initialize the object with the given Socket object.
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!
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!
JadaNetIO
public JadaNetIO(InputStream is,
OutputStream os)
- Construtor. Initialize the object with the given InputStream
and OutputStream objects.
finalize
protected void finalize() throws Throwable
- Overrides:
- finalize in class Object
close
public synchronized void close() throws IOException
- Closes the actual connection.
getSocket
public synchronized Socket getSocket()
- Returns the actual Socket object used.
getOutputStream
public synchronized DataOutputStream getOutputStream()
- Returns the actual DataOutputStream object used.
getInputStream
public synchronized DataInputStream getInputStream()
- Returns the actual DataInputStream object used.
write
public synchronized void write(int val) throws IOException
- Writes a single byte into the output stream.
read
public synchronized int read() throws IOException
- Reads a single byte from the input stream. If a EOF condition arises
a IOException is thrown.
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.
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