Class sfclasses.RelayInputStream
All Packages Class Hierarchy This Package Previous Next Index
Class sfclasses.RelayInputStream
java.lang.Object
|
+----java.io.InputStream
|
+----sfclasses.RelayInputStream
- public class RelayInputStream
- extends InputStream
This class implements an input stream to read data from a firewall system
via the relay. It uses the I/O functions implemented in the Communicator
class. Filter streams can be used on top of this stream to enhance
functionality.
-
RelayInputStream(byte[], String)
- Initialize the stream and request the file from the firewall.
-
available()
- Return number of bytes available for reading.
-
close()
- Close the input stream.
-
isEOF()
- Check if the end of the file has been reached.
-
read()
- Read one byte from the input stream
RelayInputStream
public RelayInputStream(byte h[],
String filename)
- Initialize the stream and request the file from the firewall.
- Parameters:
- h - IP address of the firewall
- filename - Name of the file to read including the full path name.
The file must be in the configuration directory /etc/firewall.d
or in the log directory /var/log.
read
public int read() throws IOException
- Read one byte from the input stream
- Returns:
- read byte or -1 on error
- Overrides:
- read in class InputStream
close
public void close() throws IOException
- Close the input stream.
- Overrides:
- close in class InputStream
available
public int available()
- Return number of bytes available for reading. If the buffer is
empty but the end of the file is not reached, 1 is returned.
- Overrides:
- available in class InputStream
isEOF
public boolean isEOF()
- Check if the end of the file has been reached.
- Returns:
- true if EOF, false otherwise
All Packages Class Hierarchy This Package Previous Next Index