Package ucar.unidata.io

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


    g2i.scan(true, false);
    List<Grib2Product> products = g2i.getProducts();
    boolean passOne = true;
    for (int i = 0; i < products.size(); i++) {
      Grib2Product product = products.get(i);
      raf.seek(product.getGdsOffset());
      GdsReader2 gds = new GdsReader2(raf, true);
      Grib2GDSVariables gpv = gds.gdsVars;
      if (passOne) {
        System.out.println(" Section = " + gpv.getSection());
        System.out.println(" Length = " + gpv.getLength());
View Full Code Here


      g1i.scan(true, false);
      ArrayList  products =  g1i.getProducts();
      boolean passOne = true;
      for (int i = 0; i < products.size(); i++) {
        Grib1Product product = (Grib1Product) products.get(i);
        raf.seek(product.getOffset1());
        PdsReader1 pds = new PdsReader1(raf);
        Grib1Pds gpv = pds.pdsVars;
        if (passOne) {
          System.out.println(" Section = " + gpv.getSection());
          System.out.println(" Length = " + gpv.getLength());
View Full Code Here

        Grib1Product product = products.get(i);
        Grib1ProductDefinitionSection pds = product.getPDS();
        Grib1Pds g1pdsv = pds.getPdsVars();
        if (product.getOffset1() == -1)
          break;
        raf.seek(product.getOffset1());
        GdsReader1 gds = new GdsReader1(raf, true);
        Grib1GDSVariables gpv = gds.gdsVars;
        if (passOne) {
          System.out.println(" Section = " + gpv.getSection());
          System.out.println(" Length = " + gpv.getLength());
View Full Code Here

    g2i.scan(true, false);
    List<Grib2Product> products = g2i.getProducts();
    boolean passOne = true;
    for (int i = 0; i < products.size(); i++) {
      Grib2Product product = products.get(i);
      raf.seek(product.getPdsOffset());
      PdsReader2 pds = new PdsReader2(raf);
      Grib2Pds gpv = pds.pdsVars;
      if (passOne) {
        System.out.println(" Section = " + gpv.getSection());
        System.out.println(" Length = " + gpv.getLength());
View Full Code Here

    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)) {
      System.out.println("--Good header= " + test);
View Full Code Here

    byte[] b = new byte[8];
    raf.read(b);
    String test = new String(b);
    if (test.equals(Level2VolumeScan.ARCHIVE2) || test.equals(Level2VolumeScan.AR2V0001)) {
      System.out.println("--Good header= " + test);
      raf.seek(24);
    } else {
      System.out.println("--No header ");
      lookForHeader = true;
      raf.seek(0);
    }
View Full Code Here

      System.out.println("--Good header= " + test);
      raf.seek(24);
    } else {
      System.out.println("--No header ");
      lookForHeader = true;
      raf.seek(0);
    }

    boolean eof = false;
    int numCompBytes;
    try {
View Full Code Here

  boolean read_comp_header() throws IOException {
    int id;
    RandomAccessFile f = FileDesc;

    // reset file position to start of file
    f.seek(0);

    // read file ID
    id = f.readInt();

    if (id == 0x80808080 || id == 0x80808081) {
View Full Code Here

    int i, n, nl;
    RandomAccessFile f = FileDesc;

    // move to position in file
    pos = grid_position(time, vr);
    f.seek(pos);

    if (FileFormat == 0x80808083) {
      // read McIDAS grid and file numbers
      int mcfile, mcgrid;
      mcfile = f.readInt();
View Full Code Here

    f = FileDesc;
    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
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.