public class PingPongTokenHandler extends java.lang.Object implements TokenHandler<Token>
Constructor and Description |
---|
PingPongTokenHandler() |
Modifier and Type | Method and Description |
---|---|
void |
convertToBytes(Token token,
java.io.DataOutputStream outputStream)
Convert the Ping or Pong token to the by stream.
|
Token |
convertToToken(java.io.DataInputStream inputStream,
java.lang.Class<? extends Token> tokenType)
Return a Ping or Pong token depending on the tokenType by deserializing the inputStream.
|
public void convertToBytes(Token token, java.io.DataOutputStream outputStream) throws java.io.IOException, IllegalActionException
convertToBytes
in interface TokenHandler<Token>
token
- the token to be convertedoutputStream
- the outputStream holding stream of bytesjava.io.IOException
- if there is a problem with the outputStreamIllegalActionException
- if there is the state becomes inconsistentTokenHandler.convertToBytes(ptolemy.data.Token, java.io.DataOutputStream)
public Token convertToToken(java.io.DataInputStream inputStream, java.lang.Class<? extends Token> tokenType) throws java.io.IOException, IllegalActionException
convertToToken
in interface TokenHandler<Token>
inputStream
- The inputStream that contains serialized version
of a tokentokenType
- the type of the token to be read.java.io.IOException
- if there is a problem with the outputStreamIllegalActionException
- if there is the state becomes inconsistent