jwo.landserf.process.gps.garmin
Class GarminInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
jwo.landserf.process.gps.garmin.GarminInputStream
- public class GarminInputStream
- extends FilterInputStream
Handles low level input from GPS. Automatically removes the DLEs
from the GPS input stream. The double-DLEs can be found in the size,
data, and checksum fields. The only method providing the filtering
functionality is read().
- Version:
- 2.2, 14th June, 2004
- Author:
- Jo Wood, based on the design by Henrik Sorensen (haas@itu.dk).
Method Summary |
int |
read()
Reads the next byte from the stream. |
int[] |
readPacket()
Reads a packet from the stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GarminInputStream
public GarminInputStream(InputStream i)
- Passes the stream to the GPS unit.
- Parameters:
i
- Input stream to channel GPS input.
readPacket
public int[] readPacket()
throws InvalidPacketException,
IOException
- Reads a packet from the stream. This assumes that this method is called
between packets. ie. when the first byte of a packet is the next in the
stream. If this condition is met, the method will leave the stream in the same state.
- Returns:
- packet data.
- Throws:
InvalidPacketException
IOException
read
public int read()
throws IOException
- Reads the next byte from the stream. Removes DLE stuffing where necessary.
- Returns:
- Next item in input stream.
- Throws:
IOException
Copyright Jo Wood, 1996-2005, last modified, 11th March, 2005