com.dalsemi.comm
Class SerialInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--com.dalsemi.comm.SerialInputStream
- public class SerialInputStream
- extends java.io.InputStream
A Serial input stream is an input stream for reading data from an serial port.
Method Summary |
int |
available()
Returns the number of bytes that can be read from this input
stream without blocking. |
void |
close()
Closes this Serial input stream and releases any system resources
associated with the stream. |
protected void |
disableReceiveThreshold()
|
protected void |
enableReceiveThreshold(int thresh)
|
protected boolean |
isReceiveThresholdEnabled()
|
int |
read()
Reads the next byte of data from this input stream. |
int |
read(byte[] barr,
int offset,
int len)
Reads the number of bytes requested from this input stream. |
void |
unread(byte b)
Method unread |
Methods inherited from class java.io.InputStream |
mark,
markSupported,
read,
reset,
skip |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
read
public int read()
throws java.io.IOException
- Reads the next byte of data from this input stream. The value
byte is returned as an
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.
- Returns:
- the next byte of data, or
-1
if the end of the
stream is reached. - Throws:
- java.io.IOException - if an I/O error occurs.
- Overrides:
- read in class java.io.InputStream
read
public int read(byte[] barr,
int offset,
int len)
throws java.io.IOException
- Reads the number of bytes requested from this input stream.
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.
- Parameters:
barr
- the array to be filled.offset
- the offset to begin writting in the array.len
- the number of bytes requested.- Returns:
- the number of bytes read or
-1
if the end of the stream
has been reached. - Throws:
- java.io.IOException -
- Overrides:
- read in class java.io.InputStream
- See Also:
unread
public void unread(byte b)
throws java.io.IOException
- Method unread
- Parameters:
b
- - Throws:
- java.io.IOException -
close
public void close()
throws java.io.IOException
- Closes this Serial input stream and releases any system resources
associated with the stream.
- Throws:
- java.io.IOException - if an I/O error occurs.
- Overrides:
- close in class java.io.InputStream
available
public int available()
throws java.io.IOException
- Returns the number of bytes that can be read from this input
stream without blocking. The available method of
InputStream
returns 0
. This method
should be overridden by subclasses.
- Returns:
- the number of bytes that can be read from this input stream
without blocking.
- Throws:
- java.io.IOException - if an I/O error occurs.
- Overrides:
- available in class java.io.InputStream
enableReceiveThreshold
protected void enableReceiveThreshold(int thresh)
throws javax.comm.UnsupportedCommOperationException
disableReceiveThreshold
protected void disableReceiveThreshold()
isReceiveThresholdEnabled
protected boolean isReceiveThresholdEnabled()
Используются технологии
uCoz