public class StringTokenHandler extends java.lang.Object implements TokenHandler<StringToken>
Constructor and Description |
---|
StringTokenHandler() |
Modifier and Type | Method and Description |
---|---|
void |
convertToBytes(StringToken token,
java.io.DataOutputStream outputStream)
Convert StringToken to a byte stream using an algorithm defined in the DataOutputStream.
|
StringToken |
convertToToken(java.io.DataInputStream inputStream,
java.lang.Class<? extends StringToken> tokenType)
Reads from the inputStream and converts it to the StringToken.
|
public void convertToBytes(StringToken token, java.io.DataOutputStream outputStream) throws java.io.IOException
convertToBytes
in interface TokenHandler<StringToken>
token
- The token to be converted to the byte stream.outputStream
- The byte stream to write the token to.java.io.IOException
- If cannot write to the stream.TokenHandler.convertToBytes(ptolemy.data.Token, java.io.DataOutputStream)
public StringToken convertToToken(java.io.DataInputStream inputStream, java.lang.Class<? extends StringToken> tokenType) throws java.io.IOException
convertToToken
in interface TokenHandler<StringToken>
inputStream
- The stream that contains the token.tokenType
- The type of the token. Should be StringToken or it's derivatives.java.io.IOException
- If the stream cannot be read.TokenHandler.convertToToken(java.io.DataInputStream, Class)