|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.ssonet.io.IOFilterStream
Base for IOStreams wich need to exchange messages asynchronous.
Field Summary | |
static boolean |
debug
|
protected org.ssonet.io.IOStream |
ios
|
protected java.util.LinkedList |
list
|
protected boolean |
protocolMode
|
protected java.io.IOException |
readException
|
protected java.lang.Thread |
runner
|
protected java.io.IOException |
writeException
|
Constructor Summary | |
IOFilterStream()
|
Method Summary | |
int |
available()
|
void |
closeIn()
Closes the Inputstream. |
void |
closeOut()
Closes the outputStream. |
protected abstract void |
handleMessage(byte b,
org.ssonet.io.IOStream ios)
Subclasses implement this to handle their messages. |
int |
read(byte[] buffer)
Reads from the IOStream. |
void |
run()
Main loop. |
void |
setIOStream(org.ssonet.io.IOStream ios)
Sets the IOStream and starts handling Messages. |
void |
write(byte[] buffer)
Writes to the IOStream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.Thread runner
protected org.ssonet.io.IOStream ios
protected java.io.IOException readException
protected java.io.IOException writeException
protected boolean protocolMode
protected java.util.LinkedList list
public static boolean debug
Constructor Detail |
public IOFilterStream()
Method Detail |
protected abstract void handleMessage(byte b, org.ssonet.io.IOStream ios) throws java.io.IOException
b
- message codeios
- IOStream to read from and write to
java.io.IOException
public void setIOStream(org.ssonet.io.IOStream ios)
public void run()
run
in interface java.lang.Runnable
public int read(byte[] buffer) throws java.io.IOException
read
in interface IOStream
buffer
- the buffer, which shall be filled with bytes read
java.io.IOException
- if an error occures while reading from the streamIOStream.read(byte[])
public void write(byte[] buffer) throws java.io.IOException
write
in interface IOStream
buffer
- the buffer holding the bytes to write to the stream
java.io.IOException
- if an error occures while writing to the streamIOStream.write(byte[])
public void closeIn() throws java.io.IOException
IOStream
closeIn
in interface IOStream
java.io.IOException
public void closeOut() throws java.io.IOException
IOStream
closeOut
in interface IOStream
java.io.IOException
public int available() throws java.io.IOException
available
in interface IOStream
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |