final class TelnetInputStream
extends java.io.BufferedInputStream
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
private int |
__bytesAvailable |
private TelnetClient |
__client |
private boolean |
__hasReachedEOF |
private java.io.IOException |
__ioException |
private boolean |
__isClosed |
private int[] |
__queue |
private int |
__queueHead |
private int |
__queueTail |
private boolean |
__readIsWaiting |
private int |
__receiveState |
private int[] |
__suboption |
private int |
__suboption_count |
private java.lang.Thread |
__thread |
private boolean |
__threaded |
(package private) static int |
_STATE_CR |
(package private) static int |
_STATE_DATA |
(package private) static int |
_STATE_DO |
(package private) static int |
_STATE_DONT |
(package private) static int |
_STATE_IAC |
(package private) static int |
_STATE_IAC_SB |
(package private) static int |
_STATE_SB |
(package private) static int |
_STATE_SE |
(package private) static int |
_STATE_WILL |
(package private) static int |
_STATE_WONT |
private static int |
EOF
End of file has been reached
|
private static int |
WOULD_BLOCK
Read would block
|
Constructor and Description |
---|
TelnetInputStream(java.io.InputStream input,
TelnetClient client) |
TelnetInputStream(java.io.InputStream input,
TelnetClient client,
boolean readerThread) |
Modifier and Type | Method and Description |
---|---|
private boolean |
__processChar(int ch) |
private int |
__read(boolean mayBlock)
Get the next byte of data.
|
(package private) void |
_start() |
int |
available() |
void |
close() |
boolean |
markSupported()
Returns false.
|
int |
read() |
int |
read(byte[] buffer)
Reads the next number of bytes from the stream into an array and
returns the number of bytes read.
|
int |
read(byte[] buffer,
int offset,
int length)
Reads the next number of bytes from the stream into an array and returns
the number of bytes read.
|
void |
run() |
private static final int EOF
private static final int WOULD_BLOCK
static final int _STATE_DATA
static final int _STATE_IAC
static final int _STATE_WILL
static final int _STATE_WONT
static final int _STATE_DO
static final int _STATE_DONT
static final int _STATE_SB
static final int _STATE_SE
static final int _STATE_CR
static final int _STATE_IAC_SB
private boolean __hasReachedEOF
private volatile boolean __isClosed
private boolean __readIsWaiting
private int __receiveState
private int __queueHead
private int __queueTail
private int __bytesAvailable
private final int[] __queue
private final TelnetClient __client
private final java.lang.Thread __thread
private java.io.IOException __ioException
private final int[] __suboption
private int __suboption_count
private volatile boolean __threaded
TelnetInputStream(java.io.InputStream input, TelnetClient client, boolean readerThread)
TelnetInputStream(java.io.InputStream input, TelnetClient client)
void _start()
private int __read(boolean mayBlock) throws java.io.IOException
mayBlock
- true if method is allowed to blockjava.io.IOException
private boolean __processChar(int ch) throws java.lang.InterruptedException
java.lang.InterruptedException
public int read() throws java.io.IOException
read
in class java.io.BufferedInputStream
java.io.IOException
public int read(byte[] buffer) throws java.io.IOException
read
in class java.io.FilterInputStream
buffer
- The byte array in which to store the data.java.io.IOException
- If an error occurs in reading the underlying
stream.public int read(byte[] buffer, int offset, int length) throws java.io.IOException
read
in class java.io.BufferedInputStream
buffer
- The byte array in which to store the data.offset
- The offset into the array at which to start storing data.length
- The number of bytes to read.java.io.IOException
- If an error occurs while reading the underlying
stream.public boolean markSupported()
markSupported
in class java.io.BufferedInputStream
public int available() throws java.io.IOException
available
in class java.io.BufferedInputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.BufferedInputStream
java.io.IOException
public void run()
run
in interface java.lang.Runnable