org.apache.commons.net.telnet

Class TelnetInputStream

Implemented Interfaces:
Runnable

(package private) final class TelnetInputStream
extends BufferedInputStream
implements Runnable

Authors:
Daniel F. Savarese
Bruno D'Avanzo

Field Summary

(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 int
__bytesAvailable
private TelnetClient
__client
private boolean
__hasReachedEOF
private 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 Thread
__thread
private boolean
__threaded
private boolean
_ayt_flag

Constructor Summary

TelnetInputStream(InputStream input, TelnetClient client)

Method Summary

private void
__processChar(int ch)
private int
__read()
(package private) void
_start()
int
available()
void
close()
boolean
markSupported()
Returns false.
int
read()
int
read(buffer[] )
Reads the next number of bytes from the stream into an array and returns the number of bytes read.
int
read(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()

Field Details

_STATE_CR

(package private) static final int _STATE_CR

Field Value:
8


_STATE_DATA

(package private) static final int _STATE_DATA

Field Value:
0


_STATE_DO

(package private) static final int _STATE_DO

Field Value:
4


_STATE_DONT

(package private) static final int _STATE_DONT

Field Value:
5


_STATE_IAC

(package private) static final int _STATE_IAC

Field Value:
1


_STATE_IAC_SB

(package private) static final int _STATE_IAC_SB

Field Value:
9


_STATE_SB

(package private) static final int _STATE_SB

Field Value:
6


_STATE_SE

(package private) static final int _STATE_SE

Field Value:
7


_STATE_WILL

(package private) static final int _STATE_WILL

Field Value:
2


_STATE_WONT

(package private) static final int _STATE_WONT

Field Value:
3


__bytesAvailable

private int __bytesAvailable


__client

private TelnetClient __client


__hasReachedEOF

private boolean __hasReachedEOF


__ioException

private IOException __ioException


__isClosed

private boolean __isClosed


__queue

private int[] __queue


__queueHead

private int __queueHead


__queueTail

private int __queueTail


__readIsWaiting

private boolean __readIsWaiting


__receiveState

private int __receiveState


__suboption

private int[] __suboption


__suboption_count

private int __suboption_count


__thread

private Thread __thread


__threaded

private boolean __threaded


_ayt_flag

private boolean _ayt_flag

Constructor Details

TelnetInputStream

(package private)  TelnetInputStream(InputStream input,
                                     TelnetClient client)

Method Details

__processChar

private void __processChar(int ch)
            throws InterruptedException


__read

private int __read()
            throws IOException


_start

(package private)  void _start()


available

public int available()
            throws IOException


close

public void close()
            throws IOException


markSupported

public boolean markSupported()
Returns false. Mark is not supported. **


read

public int read()
            throws IOException


read

public int read(buffer[] )
            throws IOException
Reads the next number of bytes from the stream into an array and returns the number of bytes read. Returns -1 if the end of the stream has been reached.

Parameters:

Returns:
The number of bytes read. Returns -1 if the end of the message has been reached.


read

public int read(buffer[] ,
                int offset,
                int length)
            throws IOException
Reads the next number of bytes from the stream into an array and returns the number of bytes read. Returns -1 if the end of the message has been reached. The characters are stored in the array starting from the given offset and up to the length specified.

Parameters:
offset - The offset into the array at which to start storing data.
length - The number of bytes to read.

Returns:
The number of bytes read. Returns -1 if the end of the stream has been reached.


run

public void run()