jhomenet.shell.server.telnet
Class TelnetInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by jhomenet.shell.server.SystemInputStream
          extended by jhomenet.shell.server.telnet.TelnetInputStream
All Implemented Interfaces:
java.io.Closeable

public class TelnetInputStream
extends SystemInputStream

This is an input stream to be used by a TelnetSession.

Version:
1.0
Author:
Stephen Hess, Lorne Smith, Kris Ardis

Field Summary
 
Fields inherited from class jhomenet.shell.server.SystemInputStream
ASCII_BS, ASCII_DEL, ASCII_SPACE, buffer, ECHO, endPos, ERASE, fileInName, out, rawMode, root, session, startPos
 
Constructor Summary
TelnetInputStream(java.io.InputStream in, java.io.PrintStream out)
          Initialize the stream.
 
Method Summary
 int rawAvailable()
          This method should be overridden by subclassing InputStreams.
protected  int rawRead()
          Read the next character from the stream.
 
Methods inherited from class jhomenet.shell.server.SystemInputStream
available, errorOccurred, getEcho, getRootStream, increaseBuffer, rawRead, read, read, readLine, setEcho, setEchoStream, setRawMode, setRootStream, setSession
 
Methods inherited from class java.io.InputStream
close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TelnetInputStream

public TelnetInputStream(java.io.InputStream in,
                         java.io.PrintStream out)
Initialize the stream.

Parameters:
in - Underlying InputStream to use.
out - PrintStream to echo characters
Method Detail

rawAvailable

public int rawAvailable()
                 throws java.io.IOException
Description copied from class: SystemInputStream
This method should be overridden by subclassing InputStreams. It returns the amount available from the underlying root stream. This is not the amount available if the SystemInputStream is not in raw mode.

Overrides:
rawAvailable in class SystemInputStream
Returns:
amount of data available directly from the underlying stream
Throws:
java.io.IOException - if an error occurs in the underlying stream.
See Also:
SystemInputStream.setRawMode(boolean), SystemInputStream.rawRead(), SystemInputStream.rawRead(byte[],int,int)

rawRead

protected int rawRead()
               throws java.io.IOException
Read the next character from the stream. This should only be called from within a synchronized block.

Overrides:
rawRead in class SystemInputStream
Returns:
the next character from the stream, or -1 if the end of the stream has been reached.
Throws:
java.io.IOException - if an IO problem occurs during the read.
See Also:
SystemInputStream.rawRead(byte[],int,int), SystemInputStream.rawAvailable(), SystemInputStream.setRawMode(boolean)


Copyright © 2004-2005 David Irwin. All Rights Reserved.