public class CloseableWhileReadingSerialInputStream
extends java.io.InputStream
implements gnu.io.SerialPortEventListener
| Constructor and Description |
|---|
CloseableWhileReadingSerialInputStream(gnu.io.SerialPort serialPort) |
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Returns an estimate of the number of bytes that can be read (or
skipped over) from this input stream without blocking by the next
invocation of a method for this input stream.
|
void |
close()
Closes this input stream and releases any system resources associated
with the stream.
|
boolean |
markSupported()
Tests if this input stream supports the
mark and
reset methods. |
int |
read()
Reads the next byte of data from the input stream.
|
void |
serialEvent(gnu.io.SerialPortEvent ev) |
public CloseableWhileReadingSerialInputStream(gnu.io.SerialPort serialPort)
throws java.io.IOException,
java.util.TooManyListenersException
java.io.IOExceptionjava.util.TooManyListenersExceptionpublic int read()
throws java.io.IOException
int in the range 0 to
255. If no byte is available because the end of the stream
has been reached, the value -1 is returned. This method
blocks until input data is available, the end of the stream is detected,
or an exception is thrown.read in class java.io.InputStream-1 if the end of the
stream is reached.java.io.IOException - if an I/O error occurs.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOException - if an I/O error occurs.public int available()
throws java.io.IOException
available in class java.io.InputStream0 when
it reaches the end of the input stream.java.io.IOException - if an I/O error occurs.public boolean markSupported()
mark and
reset methods. Whether or not mark and
reset are supported is an invariant property of a
particular input stream instance. The markSupported method
returns false.markSupported in class java.io.InputStreamtrue if this stream instance supports the mark
and reset methods; false otherwise.InputStream.mark(int),
InputStream.reset()public void serialEvent(gnu.io.SerialPortEvent ev)
serialEvent in interface gnu.io.SerialPortEventListener