public class TelnetOption
extends java.lang.Object
implements java.lang.Cloneable
Notes for subclassing:
For some options (i.e. ECHO or BINARY), it is enough to pass an option code
to the constructor to be able to use it. Many options, however, use
subnegotiation and the TelnetOption class should be subclassed. For those
options requiring subnegotiation the option class should set optionCode
in constructor and override methods readSubnegotation
and
writeSubnegotiation
for formatting/parsing option specific data.
Constructor and Description |
---|
TelnetOption(int optionCode)
Creates a new TelnetOption instance.
|
Modifier and Type | Method and Description |
---|---|
int |
getOptionCode()
Gets option code.
|
java.lang.String |
getOptionName()
Gets name of this option based on its option code.
|
void |
readSubnegotiation(java.io.InputStream in)
Reads subnegotiation data for this TelnetOption
By default this method is empty and and is intended for use in subclasses requiring
option negotiation.
|
void |
writeSubnegotiation(java.io.OutputStream out)
Writes subnegotiation data for this TelnetOption.
|
public TelnetOption(int optionCode)
0 - BINARY
Negotiates transmission of binary data
1 - ECHO
Negotiates echoing of data exchanged
24 - TERMINAL TYPE
Negotiates terminal display options
optionCode
- the option codepublic int getOptionCode()
public void writeSubnegotiation(java.io.OutputStream out) throws java.io.IOException
out
- the OutputStream to write data to.java.io.IOException
- if an I/O related error occurs.public void readSubnegotiation(java.io.InputStream in) throws java.io.IOException
in
- the InputStream to read fromjava.io.IOException
- if an I/O related error occurspublic java.lang.String getOptionName()
Copyright © JSCAPE LLC. 1999-2021. All Rights Reserved