public class TelnetInputStream extends java.io.InputStream implements SessionInfo
Modifier and Type | Method and Description |
---|---|
int |
available()
Returns an estimate of the number of bytes that can be read (or
skipped over) from this input stream without blocking by the next
invocation of a method for this input stream.
|
void |
close()
Closes this input stream and releases any system resources associated
with the stream.
|
java.lang.String |
getLanguage()
Language getter.
|
java.lang.String |
getTerminalType()
Get the terminal type as reported by the telnet Terminal Type option.
|
java.lang.String |
getUsername()
Username getter.
|
int |
getWindowHeight()
Text window height getter.
|
int |
getWindowWidth()
Text window width getter.
|
void |
mark(int readLimit)
Marks the current position in this input stream.
|
boolean |
markSupported()
Tests if this input stream supports the mark and reset methods.
|
void |
queryWindowSize()
Re-query the text window size.
|
int |
read()
Reads the next byte of data from the input stream.
|
int |
read(byte[] b)
Reads some number of bytes from the input stream and stores them into
the buffer array b.
|
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from the input stream into an array of
bytes.
|
void |
reset()
Repositions this stream to the position at the time the mark method
was last called on this input stream.
|
void |
setLanguage(java.lang.String language)
Language setter.
|
void |
setUsername(java.lang.String username)
Username setter.
|
long |
skip(long n)
Skips over and discards n bytes of data from this input stream.
|
public java.lang.String getUsername()
getUsername
in interface SessionInfo
public void setUsername(java.lang.String username)
setUsername
in interface SessionInfo
username
- the valuepublic java.lang.String getLanguage()
getLanguage
in interface SessionInfo
public void setLanguage(java.lang.String language)
setLanguage
in interface SessionInfo
language
- the valuepublic java.lang.String getTerminalType()
public int getWindowWidth()
getWindowWidth
in interface SessionInfo
public int getWindowHeight()
getWindowHeight
in interface SessionInfo
public void queryWindowSize()
queryWindowSize
in interface SessionInfo
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
- if an I/O error occurspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
- if an I/O error occurspublic void mark(int readLimit)
mark
in class java.io.InputStream
readLimit
- the maximum limit of bytes that can be read before
the mark position becomes invalidpublic boolean markSupported()
markSupported
in class java.io.InputStream
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
- if an I/O error occurspublic int read(byte[] b) throws java.io.IOException
read
in class java.io.InputStream
b
- the buffer into which the data is read.java.io.IOException
- if an I/O error occurspublic int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
b
- the buffer into which the data is read.off
- the start offset in array b at which the data is written.len
- the maximum number of bytes to read.java.io.IOException
- if an I/O error occurspublic void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
- if this function is usedpublic long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
n
- the number of bytes to be skippedjava.io.IOException
- if an I/O error occursCopyright © 2019 Kevin Lamonte. Licensed MIT.