sophware.home.io
Class NetworkAccess

java.lang.Object
  extended by sophware.home.io.NetworkAccess
All Implemented Interfaces:
HomeAccess

public class NetworkAccess
extends java.lang.Object
implements HomeAccess

NetworkAccess provides communications access to USB Devices.

Version:
1.0, 02/17/06
Author:
Russell Soph

Constructor Summary
NetworkAccess(int port)
          Creates an instance of NetworkAccess that will accept a connection request on the port
NetworkAccess(java.lang.String host, int port)
          Creates an instance of NetworkAccess and will attempt connection to remote host and port
 
Method Summary
 void close()
          Closes the USB Port
 java.io.InputStream getInputStream()
          Gets the input stream associate with the USB Port
 java.io.OutputStream getOutputStream()
          Gets the output stream associate with the USB Port
 boolean isOpen()
          Check status of the connection
 void open()
          Opens and initializes network access
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkAccess

public NetworkAccess(java.lang.String host,
                     int port)
Creates an instance of NetworkAccess and will attempt connection to remote host and port

Parameters:
host - the remote host
port - the remote port

NetworkAccess

public NetworkAccess(int port)
Creates an instance of NetworkAccess that will accept a connection request on the port

Parameters:
port - the local port
Method Detail

open

public void open()
          throws java.io.IOException
Opens and initializes network access

Specified by:
open in interface HomeAccess
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
Gets the input stream associate with the USB Port

Specified by:
getInputStream in interface HomeAccess
Returns:
the input stream

getOutputStream

public java.io.OutputStream getOutputStream()
Gets the output stream associate with the USB Port

Specified by:
getOutputStream in interface HomeAccess
Returns:
the output stream

close

public void close()
Closes the USB Port

Specified by:
close in interface HomeAccess

isOpen

public boolean isOpen()
Check status of the connection

Specified by:
isOpen in interface HomeAccess
Returns:
true if connection is open