gnu.io
Class RXTXPort.SerialInputStream
java.lang.Object
java.io.InputStream
gnu.io.RXTXPort.SerialInputStream
- Enclosing class:
- RXTXPort
- class RXTXPort.SerialInputStream
- extends java.io.InputStream
Inner class for SerialInputStream
Fields inherited from class java.io.InputStream |
|
Method Summary |
int |
available()
|
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
int |
read(byte[] b,
int off,
int len,
byte[] t)
|
Methods inherited from class java.io.InputStream |
close, mark, markSupported, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RXTXPort.SerialInputStream
RXTXPort.SerialInputStream()
read
public int read()
throws java.io.IOException
- Returns:
- int the int read
- Throws:
java.io.IOException
- See Also:
timeout threshold Behavior
------------------------------------------------------------------------
0 0 blocks until 1 byte is available timeout > 0,
threshold = 0, blocks until timeout occurs, returns -1
on timeout
>0 >0 blocks until timeout, returns - 1 on timeout, magnitude
of threshold doesn't play a role.
0 >0 Blocks until 1 byte, magnitude of threshold doesn't
play a role
read
public int read(byte[] b)
throws java.io.IOException
- Returns:
- int number of bytes read
- Throws:
java.io.IOException
- timeout threshold Behavior
------------------------------------------------------------------------
0 0 blocks until 1 byte is available
>0 0 blocks until timeout occurs, returns 0 on timeout
>0 >0 blocks until timeout or reads threshold bytes,
returns 0 on timeout
0 >0 blocks until reads threshold bytes
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Parameters:
off
- len
-
- Returns:
- int number of bytes read
- Throws:
java.io.IOException
- timeout threshold Behavior
------------------------------------------------------------------------
0 0 blocks until 1 byte is available
>0 0 blocks until timeout occurs, returns 0 on timeout
>0 >0 blocks until timeout or reads threshold bytes,
returns 0 on timeout
0 >0 blocks until either threshold # of bytes or len bytes,
whichever was lower.
read
public int read(byte[] b,
int off,
int len,
byte[] t)
throws java.io.IOException
- Parameters:
off
- len
-
- Returns:
- int number of bytes read
- Throws:
java.io.IOException
- We are trying to catch the terminator in the native code
Right now it is assumed that t[] is an array of 2 bytes.
if the read encounters the two bytes, it will return and the
array will contain the terminator. Otherwise read behavior should
be the same as read( b[], off, len ). Timeouts have not been well
tested.
available
public int available()
throws java.io.IOException
- Returns:
- int bytes available
- Throws:
java.io.IOException