jwo.landserf.process.gps.garmin
Class GarminSerialOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by jwo.landserf.process.gps.garmin.GarminSerialOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class GarminSerialOutputStream
extends FilterOutputStream

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

Version:
2.3, 24th August, 2006.
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
GarminSerialOutputStream(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 stream 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

GarminSerialOutputStream

public GarminSerialOutputStream(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
Writes a packet of data to the output stream and performs DLE stuffing where necessary.

Parameters:
packet - Packet to write.
Throws:
IOException - if problem writing to output stream.


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