public abstract class ModbusInputStream extends InputStream
InputStream class with ModbusInputStream#readShortLE()
and ModbusInputStream#readShortBE() methods. Also it allows to set max read
operation time with ModbusInputStream#setReadTimeout() method.| Constructor and Description |
|---|
ModbusInputStream() |
| Modifier and Type | Method and Description |
|---|---|
int |
read(byte[] b)
default implementation of reading of a byte array.
|
int |
readShortBE()
read two bytes in Big Endian Byte Order
|
int |
readShortLE()
read two bytes in Little Endian Byte Order
|
abstract void |
setReadTimeout(int readTimeout)
sets a timeout value. if there is a timeout of read operation a stream must throw new IO exception.
|
available, close, mark, markSupported, read, read, reset, skippublic int read(byte[] b)
throws IOException
read in class InputStreamb - a byte array to fill by values from the input stream.IOException - if there is a read operation timeoutNullPointerException - if b is null.public abstract void setReadTimeout(int readTimeout)
readTimeout - is a timeout value in millisecondspublic int readShortBE()
throws IOException
IOExceptionreadShortLE()public int readShortLE()
throws IOException
IOExceptionreadShortBE()Copyright © 2018. All rights reserved.