ucar.grib.grib1
Class Grib1WriteIndex

java.lang.Object
  extended by ucar.grib.grib1.Grib1WriteIndex

public class Grib1WriteIndex
extends java.lang.Object

Creates an index for a Grib1 file; optionally makes an in-memory one.

Author:
Robb Kambic

Constructor Summary
Grib1WriteIndex()
           
 
Method Summary
 GridIndex extendGribIndex(java.io.File grib, java.io.File gbx, java.lang.String gbxName, ucar.unidata.io.RandomAccessFile raf, boolean makeIndex)
          extend a Grib file index; optionally create an in-memory index.
 GridIndex extendGribIndex(java.io.File grib, java.io.File gbx, java.lang.String gribName, java.lang.String gbxName, boolean makeIndex)
          extend a Grib file index; optionally create an in-memory index.
 boolean extendGribIndex(java.lang.String gbxName, ucar.unidata.io.RandomAccessFile inputRaf, long rafLastModified, java.io.DataOutputStream out)
          extend a Grib file index; optionally create an in-memory index.
static void main(java.lang.String[] args)
          creates a Grib1 index for given Grib1 file.
 void setDebug(boolean flag)
           
 void setVerbose(boolean flag)
           
 GridIndex writeGribIndex(java.io.File grib, java.lang.String gbxName, ucar.unidata.io.RandomAccessFile raf, boolean makeIndex)
          extend a Grib file index; optionally create an in-memory index.
 GridIndex writeGribIndex(java.io.File grib, java.lang.String gribName, java.lang.String gbxName, boolean makeIndex)
          create a Grib1 file index.
 boolean writeGribIndex(ucar.unidata.io.RandomAccessFile inputRaf, long rafLastModified, java.io.DataOutputStream out)
          Write a Grib file index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grib1WriteIndex

public Grib1WriteIndex()
Method Detail

writeGribIndex

public final GridIndex writeGribIndex(java.io.File grib,
                                      java.lang.String gribName,
                                      java.lang.String gbxName,
                                      boolean makeIndex)
                               throws java.io.IOException
create a Grib1 file index.

Parameters:
grib - as File handle
gribName - gribName
gbxName - gbxName
makeIndex - make an in-memory index if true
Returns:
Index if makeIndex is true, else null
Throws:
java.io.IOException - on Grib read

writeGribIndex

public final GridIndex writeGribIndex(java.io.File grib,
                                      java.lang.String gbxName,
                                      ucar.unidata.io.RandomAccessFile raf,
                                      boolean makeIndex)
                               throws java.io.IOException
extend a Grib file index; optionally create an in-memory index.

Parameters:
grib - Grib file
gbxName - Index name
raf - RandomAccessFile
makeIndex - make an in-memory index if true
Returns:
Index if makeIndex is true, else null
Throws:
java.io.IOException - on Grib file read

writeGribIndex

public final boolean writeGribIndex(ucar.unidata.io.RandomAccessFile inputRaf,
                                    long rafLastModified,
                                    java.io.DataOutputStream out)
                             throws java.io.IOException
Write a Grib file index.

Parameters:
inputRaf - GRIB file raf
rafLastModified - long
out - DataOutputStream
Returns:
success boolean.
Throws:
java.io.IOException - on Grib file read

extendGribIndex

public final GridIndex extendGribIndex(java.io.File grib,
                                       java.io.File gbx,
                                       java.lang.String gribName,
                                       java.lang.String gbxName,
                                       boolean makeIndex)
                                throws java.io.IOException
extend a Grib file index; optionally create an in-memory index.

Parameters:
grib - as a File
gbx - as a File
gribName - as a String
gbxName - as a String
makeIndex - make an in-memory index if true
Returns:
GridIndex if makeIndex is true, else null
Throws:
java.io.IOException - on gbx write

extendGribIndex

public final GridIndex extendGribIndex(java.io.File grib,
                                       java.io.File gbx,
                                       java.lang.String gbxName,
                                       ucar.unidata.io.RandomAccessFile raf,
                                       boolean makeIndex)
                                throws java.io.IOException
extend a Grib file index; optionally create an in-memory index.

Parameters:
grib - as a File
gbx - as a File
gbxName - as a String
raf - RandomAccessFile
makeIndex - make an in-memory index if true
Returns:
GridIndex if makeIndex is true, else null
Throws:
java.io.IOException - gbx write

extendGribIndex

public final boolean extendGribIndex(java.lang.String gbxName,
                                     ucar.unidata.io.RandomAccessFile inputRaf,
                                     long rafLastModified,
                                     java.io.DataOutputStream out)
                              throws java.io.IOException
extend a Grib file index; optionally create an in-memory index.

Parameters:
gbxName - a GridIndex is used to extend/create a new GridIndex
inputRaf - GRIB file raf
rafLastModified - of the raf
out - where to write
Returns:
Index if makeIndex is true, else null
Throws:
java.io.IOException - on gbx write

setDebug

public void setDebug(boolean flag)

setVerbose

public void setVerbose(boolean flag)

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
creates a Grib1 index for given Grib1 file.

Parameters:
args - 2 if Grib file and index file name given
Throws:
java.io.IOException - on raf read