|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
Serialio.SerInputStream
Create an input stream on the serial port object.
| Field Summary | |
protected SerialPort |
sp
|
| Constructor Summary | |
SerInputStream(SerialPort sp)
Create a serial port input stream. |
|
| Method Summary | |
void |
abort()
Abort the current read |
int |
available()
Indicates the number of bytes ready for reading |
void |
close()
Closes this input stream |
int |
getNapTime()
|
boolean |
getNativeBlock()
|
int |
getRcvFrameChar()
|
int |
getRcvThreshold()
|
int |
getRcvTimeout()
|
int |
read()
Reads data from the input stream. |
int |
read(byte[] buf)
Reads data from the input stream NOTE: framing is ignored by this method, use read() for framing NOTE: if threshold & timeout are enabled, and timeout occurs before threshold is reached, method will return available data. |
int |
read(byte[] buf,
int off,
int len)
Reads data from the input stream NOTE: framing is ignored by this method, use read() for framing NOTE: if threshold & timeout are enabled, and timeout occurs before threshold is reached, method will return available data. |
void |
setNapTime(int time)
Set the nap time used when the method sleeps |
void |
setNativeBlock(boolean onOff)
Control if block is done in Java or native code when more bytes are requested than are available. |
void |
setRcvFrameChar(int data)
Set to -1 to disable |
void |
setRcvThreshold(int thresh)
Set thresh to 1 to 'disable' |
void |
setRcvTimeout(int timeout)
Set receive timeout in milliseconds. |
| Methods inherited from class java.io.InputStream |
mark, markSupported, reset, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected SerialPort sp
| Constructor Detail |
public SerInputStream(SerialPort sp)
throws java.io.IOException
sp - a valid open SerialPort object| Method Detail |
public int read()
throws java.io.IOException
java.io.IOException - if an I/O error occurs.
public int read(byte[] buf)
throws java.io.IOException
buf - the byte array buffer where data will be put when read
java.io.IOException - if an I/O error occurs.
public int read(byte[] buf,
int off,
int len)
throws java.io.IOException
buf - the byte array buffer where data will be put when readoff - the offset in the buffer where data will be putlen - the length of data requested to be put in the buffer
java.io.IOException - if an error occurs.
public int available()
throws java.io.IOException
java.io.IOException - if an I/O error occurs.
public void close()
throws java.io.IOException
java.io.IOException - if an I/O error occurs.public void abort()
public void setRcvThreshold(int thresh)
public int getRcvThreshold()
public void setRcvTimeout(int timeout)
public int getRcvTimeout()
public void setRcvFrameChar(int data)
public int getRcvFrameChar()
public void setNapTime(int time)
public int getNapTime()
public void setNativeBlock(boolean onOff)
public boolean getNativeBlock()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||