net.wimpi.modbus.io
Class ASCIIInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by net.wimpi.modbus.io.ASCIIInputStream
All Implemented Interfaces:
Closeable

public class ASCIIInputStream
extends FilterInputStream

Class implementing a specialized InputStream which decodes characters read from the raw stream into bytes. Note that the characters denoting start and end of a frame as given by the specification are exceptions; They are translated to the "virtual" FRAME_START and FRAME_END.

Version:
@version@ (@date@)
Author:
Dieter Wimberger
See Also:
ModbusASCIITransport.FRAME_START, ModbusASCIITransport.FRAME_END

Constructor Summary
ASCIIInputStream(InputStream in)
          Constructs a new ASCIIInputStream instance reading from the given InputStream.
 
Method Summary
 int read()
          Reads a byte from the ASCII encoded stream.
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASCIIInputStream

public ASCIIInputStream(InputStream in)
Constructs a new ASCIIInputStream instance reading from the given InputStream.

Parameters:
in - a base input stream to be wrapped.
Method Detail

read

public int read()
         throws IOException
Reads a byte from the ASCII encoded stream.

Overrides:
read in class FilterInputStream
Returns:
int the byte read from the stream.
Throws:
IOException - if an I/O error occurs.


Copyright © 2010. All Rights Reserved.