jwo.landserf.process.gps.garmin
Class GarminInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by jwo.landserf.process.gps.garmin.GarminInputStream
All Implemented Interfaces:
Closeable

Deprecated. Use GarminSerialInputStream instead.

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.3, 23rd August, 2006.
Author:
Jo Wood, based on the design by Henrik Sorensen (haas@itu.dk).

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
GarminInputStream(InputStream i)
          Deprecated. Passes the stream to the GPS unit.
 
Method Summary
 int read()
          Deprecated. Reads the next byte from the stream.
 int[] readPacket()
          Deprecated. Reads a packet from the stream.
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GarminInputStream

public GarminInputStream(InputStream i)
Deprecated. 
Passes the stream to the GPS unit.

Parameters:
i - Input stream to channel GPS input.
Method Detail

readPacket

public int[] readPacket()
                 throws InvalidPacketException,
                        IOException
Deprecated. 
Reads a packet from the stream. This assumes that this method is called between packets. i.e. 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 - if packet does not contain expected header or footer bytes.
IOException - if problem reading from input stream.

read

public int read()
         throws IOException
Deprecated. 
Reads the next byte from the stream. Removes DLE stuffing where necessary.

Overrides:
read in class FilterInputStream
Returns:
Next item in input stream.
Throws:
IOException - if problem reading from input stream.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009