org.mbari.hobilabs
Class HRParser

java.lang.Object
  extended byorg.mbari.hobilabs.HRParser

public class HRParser
extends java.lang.Object

HRParser is the main data parser engine for Decoders and Converters in the org.mbari.hobilabs.hr parckage. Most decoders in this package layer some functionality on top of HRParser but all user this parsing engine. HRParser is used to parse a binary stream of data from a Hobilabs hydrorad instrument. Data collected using MBARI's OASIS controller will be in ASCII hexadecimal format and will need to be converted back to binary (using AsciiHexInputStream)

A typical use of this class:
HRParser p = new HRParser( ... ) p.parseFile(); HRPacket[] data = p.get();

Author:
Brian Schlining

Constructor Summary
HRParser(java.io.DataInputStream in)
           
HRParser(java.io.InputStream in)
          HRParser will accept any InputStream.
 
Method Summary
 HRPacket[] get()
          This method is used to get the data after it's been parsed
 void parse()
          Call this method to start the actual processing.
 void parseFile()
          Deprecated. Use parse() instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HRParser

public HRParser(java.io.InputStream in)
         throws java.io.IOException
HRParser will accept any InputStream. Internally this will be changed to a DataInputStream. To start the parsing of the file call the parseFile method.

Parameters:
in - InputStream from the file to parse

HRParser

public HRParser(java.io.DataInputStream in)
         throws java.io.IOException
Parameters:
in - A DataInputStream from the file to parse
Method Detail

parseFile

public void parseFile()
               throws java.io.IOException
Deprecated. Use parse() instead

Call this method to start the actual processing.

Throws:
java.io.IOException

parse

public void parse()
           throws java.io.IOException
Call this method to start the actual processing.

Throws:
java.io.IOException

get

public HRPacket[] get()
This method is used to get the data after it's been parsed

Returns:
An array of HRPackets. Each Packet contains one sample.