jwo.landserf.process.gps.garmin
Class GarminOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended byjwo.landserf.process.gps.garmin.GarminOutputStream

public class GarminOutputStream
extends FilterOutputStream

Handles low level output to GPS. Automatically adds DLEs to the GPS input stream. The only method providing the DLE stuffing is write(). The remaining methods write directly to the GPS without format control.

Version:
2.2, 15th June, 2004
Author:
Jo Wood, based on the design by Henrik Sorensen (haas@itu.dk).

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
GarminOutputStream(OutputStream o)
          Creates a DLE stuffing output stream to the GPS.
 
Method Summary
 void write(GarminPacket packet)
          Writes a packet of data to the output sream and performs DLE stuffing where necessary.
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GarminOutputStream

public GarminOutputStream(OutputStream o)
Creates a DLE stuffing output stream to the GPS.

Parameters:
o - Output stream.
Method Detail

write

public void write(GarminPacket packet)
           throws IOException,
                  InvalidPacketException
Writes a packet of data to the output sream and performs DLE stuffing where necessary.

Parameters:
packet - Packet to write.
Throws:
IOExcepetion - if problem writing to output stream.
InvalidPacketException - if packet is malformed.
IOException


Copyright Jo Wood, 1996-2005, last modified, 11th March, 2005