com.dalsemi.shell.server.serial
Class SerialInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--com.dalsemi.shell.server.SystemInputStream
              |
              +--com.dalsemi.shell.server.serial.SerialInputStream

public class SerialInputStream
extends SystemInputStream

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


Fields inherited from class com.dalsemi.shell.server.SystemInputStream
buffer, ECHO, endPos, ERASE, fileInName, out, rawMode, root, session, startPos
 
Constructor Summary
SerialInputStream(InputStream in, PrintStream out)
          Initialize the stream.
 
Method Summary
protected  int rawAvailable()
          This method should be overridden by subclassing InputStreams.
protected  int rawRead()
          This method should be overridden by subclassing InputStreams.
 
Methods inherited from class com.dalsemi.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

SerialInputStream

public SerialInputStream(InputStream in,
                         PrintStream out)
Initialize the stream.
Parameters:
in - Underlying InputStream to use.
out - PrintStream to echo characters
Method Detail

rawAvailable

protected int rawAvailable()
                    throws 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
Tags copied from class: SystemInputStream
Returns:
amount of data available directly from the underlying stream
Throws:
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 IOException
Description copied from class: SystemInputStream
This method should be overridden by subclassing InputStreams. It should only be called from within a synchronized block. It blocks until data is available and returns the first value it reads. It does not wait for an end of line sequence.
Overrides:
rawRead in class SystemInputStream
Tags copied from class: SystemInputStream
Returns:
the value read from the underlying stream
Throws:
IOException - if an error occurs reading from the underlying stream.
See Also:
SystemInputStream.rawRead(byte[],int,int), SystemInputStream.rawAvailable(), SystemInputStream.setRawMode(boolean)