+#ifndef DATREAD_H
+#define DATREAD_H
+
+#include <ostream>
+#include <fstream>
+
+#include <boost/iostreams/filtering_streambuf.hpp>
+#include <boost/iostreams/filter/bzip2.hpp>
+
+using namespace std;
+
+class datread {
+ public:
+ datread (const unsigned int& _blocksize, ostream *_log=NULL);
+ ~datread ();
+ int openFile (const string& filename);
+ enum class Format {DAT, EDAT, SDAT};
+ void * getHeader (const string& headerid);
+ int readFullBlock (char *tmpData);
+ bool fisopen ();
+ string getParaString ();
+ void closeFile ();
+ private:
+ const unsigned int blocksize;
+ ifstream infile;
+ Format format;
+ string parastring;
+ boost::iostreams::filtering_istreambuf *inbuffer;
+ ostream * const log;
+ int readDataToMem (char *tmpData, long unsigned int dataSize);
+ string filename;
+ int readHeader ();
+ vector< pair<unsigned long, void *> > headerStore;
+ void deleteHeaderStore ();
+ bool readAllHeaders ();
+ static unsigned long hash(const string& str);
+};
+
+#endif