Package ucar.unidata.io

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


      } else {
        System.exit(0);
      }
      // test for a user defined parameter table read
      //GribPDSParamTable.addParameterUserLookup( "/local/robb/trunk20081229/grib/resources/resources/grib/tables/userlookup.lst");
      raf.order(RandomAccessFile.BIG_ENDIAN);
      // Create Grib1Input instance
      Grib1Input g1i = new Grib1Input(raf);
      // boolean params getProducts, oneRecord
      g1i.scan(false, false);
      // record contains objects for all 5 Grib1 sections
View Full Code Here


  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);
View Full Code Here

  }

  private void compareGDS2(String gribFile) throws IOException {

    RandomAccessFile raf = new RandomAccessFile(gribFile, "r");
    raf.order(RandomAccessFile.BIG_ENDIAN);
    System.out.println("Comparing GDSs");
    Grib2Input g2i = new Grib2Input(raf);
    // params getProducts (implies  unique GDSs too), oneRecord
    g2i.scan(true, false);
    List<Grib2Product> products = g2i.getProducts();
View Full Code Here


  private void comparePDS1(String gribFile) throws IOException {

    RandomAccessFile raf = new RandomAccessFile(gribFile, "r");
    raf.order(RandomAccessFile.BIG_ENDIAN);
    System.out.println("Comparing PDSs");
    try {
       Input1 g1i = new  Input1(raf);
      // params getProducts (implies  unique GDSs too), oneRecord
      g1i.scan(true, false);
View Full Code Here

  }

  private void compareGDS1(String gribFile) throws IOException {

    RandomAccessFile raf = new RandomAccessFile(gribFile, "r");
    raf.order(RandomAccessFile.BIG_ENDIAN);
    System.out.println("Comparing GDSs");
    try {

      Grib1Input g1i = new  Grib1Input(raf);
      // params getProducts (implies  unique GDSs too), oneRecord
View Full Code Here

  }

  private void comparePDS2(String gribFile) throws IOException {

    RandomAccessFile raf = new RandomAccessFile(gribFile, "r");
    raf.order(RandomAccessFile.BIG_ENDIAN);
    System.out.println("Comparing PDSs");
    Grib2Input g2i = new Grib2Input(raf);
    // params getProducts (implies  unique GDSs too), oneRecord
    g2i.scan(true, false);
    List<Grib2Product> products = g2i.getProducts();
View Full Code Here

  static public long testValid(String ufilename) throws IOException {
    boolean lookForHeader = false;

    // gotta make it
    RandomAccessFile raf = new RandomAccessFile(ufilename, "r");
    raf.order(RandomAccessFile.BIG_ENDIAN);
    raf.seek(0);
    byte[] b = new byte[8];
    raf.read(b);
    String test = new String(b);
    if (test.equals(Level2VolumeScan.ARCHIVE2) || test.equals(Level2VolumeScan.AR2V0001)) {
View Full Code Here

    // Reading of Grib files must be inside a try-catch block
    try {
      RandomAccessFile raf;
      raf = new RandomAccessFile(args[0], "r");
      raf.order(RandomAccessFile.BIG_ENDIAN);
     
      Class c = ucar.nc2.iosp.grib.GribGridServiceProvider.class;
      IOServiceProvider iosp = null;
      try {
        iosp = (IOServiceProvider) c.newInstance();
View Full Code Here

    int order = f.BIG_ENDIAN;

    // first try to read the header id, check the endianness
    while (true) {
      f.seek(0);
      f.order(order);
      id = f.readInt();
      idlen = f.readInt();
      if (id == TAG_ID && idlen == 0) {
        // this is a v5d file
        FileFormat = 0;
View Full Code Here

  static public long testValid(String ufilename) throws IOException {
    boolean lookForHeader = false;

    // gotta make it
    RandomAccessFile raf = new RandomAccessFile(ufilename, "r");
    raf.order(RandomAccessFile.LITTLE_ENDIAN); //.BIG_ENDIAN);
    raf.seek(0);
    byte[] b = new byte[8];
    raf.read(b);
    String test = new String(b);
    if (test.equals(Cinrad2VolumeScan.ARCHIVE2) || test.equals(Cinrad2VolumeScan.AR2V0001)) {
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.