* @throws IOException on io error
*/
// process command line switches
static public void main(String[] args) throws IOException, NoValidGribException {
RandomAccessFile raf = null;
PrintStream ps = System.out;
String infile = args[0];
raf = new RandomAccessFile(infile, "r");
raf.order(RandomAccessFile.BIG_ENDIAN);
// This is the GDS offset
raf.skipBytes(Integer.parseInt(args[1]));
// backup to PDS; most of the time it's only 28 bytes
//raf.skipBytes( -28 ); //TODO: check
Grib1ProductDefinitionSection pds = new Grib1ProductDefinitionSection(raf);
Grib1Pds gpv = pds.pdsVars;
ps.println("Length = " + gpv.getLength());
ps.println("TimeRangeIndicator = " + gpv.getTimeRangeIndicator());
assert (pds.length == gpv.getLength());
assert (pds.table_version == gpv.getParameterTableVersion());
assert (pds.center_id == gpv.getCenter());
assert (pds.typeGenProcess == gpv.getGenProcessId());