Package ucar.unidata.io

Examples of ucar.unidata.io.RandomAccessFile.order()


    System.out.printf("Dump %s%n", filename);
    RandomAccessFile raf = new RandomAccessFile(filename, "r");
    NetcdfFile ncfile = new MyNetcdfFile();

    // its a netcdf-3 file
    raf.order(RandomAccessFile.BIG_ENDIAN);
    N3header headerParser = new N3header();

    headerParser.read(raf, ncfile, new Formatter(System.out));
    raf.close();
  }
View Full Code Here


      } else if (args.length == 1) {
        raf = new RandomAccessFile(args[0], "r");
      } else {
        System.exit(0);
      }
      raf.order(RandomAccessFile.BIG_ENDIAN);
      // Create Grib2Input instance
      Grib2Input g2i = new Grib2Input(raf);
      // boolean params getProductsOnly, oneRecord
      g2i.scan(false, false);
      // record contains objects for all 8 Grib2 sections
View Full Code Here

  static public void main(String[] args) throws IOException {
    RandomAccessFile raf    = null;
    PrintStream ps = System.out;
    String           infile = args[0];
    raf = new RandomAccessFile(infile, "r");
    raf.order(RandomAccessFile.BIG_ENDIAN);
    raf.skipBytes( Integer.parseInt( args[1]));
    Grib2ProductDefinitionSection pds = new Grib2ProductDefinitionSection( raf, 0 );
    Grib2Pds gpv = pds.pdsVars;
    ps.println( "Section = "+ gpv.getSection());
    ps.println( "Length = "+ gpv.getLength());
View Full Code Here

      // input file and Gds/Pds Offsets given
      if ((args.length == 3) || (args.length == 4)) {
        // Create RandomAccessFile
        raf = new RandomAccessFile(args[0], "r");
        raf.order(RandomAccessFile.BIG_ENDIAN);
        GdsOffset = Long.parseLong(args[1]);
        PdsOffset = Long.parseLong(args[2]);
      } else {
        System.exit(0);
      }
View Full Code Here

    // default from standalone indexer, check for duplicate records and log to System.out
    //checkPDS = true;
    logPDS = pdsLogType.systemout;
    try {
      raf = new RandomAccessFile(gribName, "r");
      raf.order(RandomAccessFile.BIG_ENDIAN);
      return writeGribIndex(grib, gbxName, raf, makeIndex);
    } finally {
      if (raf != null)
        raf.close();
    }
View Full Code Here

    // default from standalone indexer, check for duplicate records and log to System.out
    //checkPDS = true;
    logPDS = pdsLogType.systemout;
    try {
      raf = new RandomAccessFile(gribName, "r");
      raf.order(RandomAccessFile.BIG_ENDIAN);
      return extendGribIndex(grib, gbx, gbxName, raf, makeIndex);
    } finally {
      if (raf != null)
        raf.close();
    }
View Full Code Here

    // default from standalone indexer, check for duplicate records and log to System.out
    checkPDS = true;
    logPDS = Grib2WriteIndex.pdsLogType.systemout;
    try {
      raf = new RandomAccessFile(gribName, "r");
      raf.order(RandomAccessFile.BIG_ENDIAN);
      return  writeGribIndex( grib, gbxName, raf, makeIndex);
    } finally {
      if (raf != null)
        raf.close();
    }
View Full Code Here

    // default from standalone indexer, check for duplicate records and log to System.out
    checkPDS = true;
    logPDS = Grib2WriteIndex.pdsLogType.systemout;
    try {
      raf = new RandomAccessFile(gribName, "r");
      raf.order(RandomAccessFile.BIG_ENDIAN);
      return extendGribIndex( grib,  gbx, gbxName, raf,  makeIndex);
    } finally {
      if (raf != null)
        raf.close();
    }
View Full Code Here

      boolean bmsExists = true;
      int decimalScale = 1;
      // input file, offset, decimalScale given
      // Create RandomAccessFile
      raf = new RandomAccessFile(args[0], "r");
      raf.order(RandomAccessFile.BIG_ENDIAN);
      offset1 = Long.decode(args[1]).longValue();
      //if ((args.length == 4) || (args.length == 5)) {
      if ((args.length == 4)) {
        decimalScale = Integer.parseInt(args[2]);
        Boolean B = Boolean.valueOf(args[3]);
View Full Code Here

            // input file and Gds/Pds Offsets given
            if (args.length == 1) {
                // Create RandomAccessFile
                raf = new RandomAccessFile(args[0], "r");
                raf.order(RandomAccessFile.BIG_ENDIAN);
                //GdsOffset = Long.parseLong(args[1]);
                //PdsOffset = Long.parseLong(args[2]);
            } else {
                System.exit(0);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.