public class SlowLineReader
extends java.lang.Object
| Constructor and Description |
|---|
SlowLineReader(java.io.InputStream in) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
java.lang.StringBuffer |
getLastRead()
Returns the new bytes we found in the last call to readLine().
|
java.lang.String |
readLine()
Returns null if it can't read a complete line.
|
public void close()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.StringBuffer getLastRead()
public java.lang.String readLine()
throws java.io.IOException
Returns null if it can't read a complete line. Internally, this function stops reading if it reaches the end of a complete line or if the next read would block.
If there baud rate is set incorrectly or there is too much line noise, there is never a complete line, and the accumulation buffer overflows. To counter that, this function gives up looking for a complete line and returns what is has read if the accumulated partial line is longer than 160 characters, which is twice the length of a normal NMEA line.
java.io.IOException