org.ssonet.io
Class NullFilterStream

java.lang.Object
  |
  +--org.ssonet.io.IOFilterStream
        |
        +--org.ssonet.io.NullFilterStream
All Implemented Interfaces:
IOStream, java.lang.Runnable

public class NullFilterStream
extends IOFilterStream

Simple Implementation of an IOFilterStream. Provides a simple ping protocol.

Version:
$Id: NullFilterStream.java,v 1.2 2003/10/20 13:33:30 tk4 Exp $
Author:
Thomas Kriegelstein

Field Summary
(package private)  byte[] b
           
 
Fields inherited from class org.ssonet.io.IOFilterStream
debug, ios, list, protocolMode, readException, runner, writeException
 
Constructor Summary
NullFilterStream()
           
 
Method Summary
 void handleMessage(byte b, org.ssonet.io.IOStream ios)
          Subclasses implement this to handle their messages.
 void ping()
          Sends a dummy message to the Stream.
 void setIOStream(org.ssonet.io.IOStream ios)
          Sets the IOStream and starts handling Messages.
 
Methods inherited from class org.ssonet.io.IOFilterStream
available, closeIn, closeOut, read, run, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

b

byte[] b
Constructor Detail

NullFilterStream

public NullFilterStream()
Method Detail

ping

public void ping()
          throws java.io.IOException
Sends a dummy message to the Stream.

Throws:
java.io.IOException

handleMessage

public void handleMessage(byte b,
                          org.ssonet.io.IOStream ios)
                   throws java.io.IOException
Description copied from class: IOFilterStream
Subclasses implement this to handle their messages. b==0 means data and never reaches this method, only protocol messages are handled here. Subclasses have to take care of length encoding.

Specified by:
handleMessage in class IOFilterStream
Parameters:
b - message code
ios - IOStream to read from and write to
java.io.IOException

setIOStream

public void setIOStream(org.ssonet.io.IOStream ios)
Description copied from class: IOFilterStream
Sets the IOStream and starts handling Messages.

Overrides:
setIOStream in class IOFilterStream


Copyright © 2003 DRIM Team. All Rights Reserved.