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.
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 |
open
protected void open()
throws java.io.IOException
- Opens the Serial input stream for reading.
- Throws:
- java.io.IOException - if an I/O error occurs.
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.
- Overrides:
- read in class java.io.InputStream
- 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.
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.
- Overrides:
- read in class java.io.InputStream
- 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 -
- See Also:
close
public void close()
throws java.io.IOException
- Closes this Serial input stream and releases any system resources
associated with the stream.
- Overrides:
- close in class java.io.InputStream
- Throws:
- java.io.IOException - if an I/O error occurs.
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.
- Overrides:
- available in class java.io.InputStream
- 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.
enableReceiveThreshold
protected void enableReceiveThreshold(int thresh)
throws javax.comm.UnsupportedCommOperationException
getReceiveThreshold
protected int getReceiveThreshold()
disableReceiveThreshold
protected void disableReceiveThreshold()
isReceiveThresholdEnabled
protected boolean isReceiveThresholdEnabled()
enableReceiveTimeout
protected void enableReceiveTimeout(int thresh)
throws javax.comm.UnsupportedCommOperationException
getReceiveTimeout
protected int getReceiveTimeout()
disableReceiveTimeout
protected void disableReceiveTimeout()
isReceiveTimeoutEnabled
protected boolean isReceiveTimeoutEnabled()
Also see:
o TINI 1.11 API, Optional Modules
o TINI Home Page
o 1-Wire API
Last update Fri Jan 24 12:06:43 CST 2003
Используются технологии
uCoz