net.sourceforge.jgrib
Class GribRecordIS

Object
  extended by GribRecordIS

public final class GribRecordIS
extends Object

A class that represents the indicator section (IS) of a GRIB record.

Author:
Benjamin Stark, Richard D. Gonzalez - modified to indicate support of GRIB EDITION 1 only, Simone Giannecchini

Constructor Summary
GribRecordIS(ImageInputStream in)
          Constructs a GribRecordIS object from an image input stream which can link to a file or a strem.
GribRecordIS(int edition)
          GribRecordIS.
GribRecordIS(int edition, int PDS, int GDS, int BMS, int BDS)
           
 
Method Summary
 boolean equals(Object obj)
           
 int getGribEdition()
          Get the EDITION of the GRIB specification used.
 int getGribLength()
          Get the byte gribLength of this GRIB record.
 int getLength()
          Get the byte gribLength of the IS section.
 void setLength(int PDS, int GDS, int BMS, int BDS)
          This method is used to set the gribLength of the Indicato Section for the current grib record.
 String toString()
          Get a string representation of this IS.
 void writeTo(OutputStream out)
          writeTo(OutputStream out) Write the indicator section to
 
Methods inherited from class Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GribRecordIS

public GribRecordIS(int edition)
GribRecordIS. This constructor is used to build the IS section from scratch using the other section. This choice has been since the IS contains the gribLength of the overall record, therefore it needs to know the gribLength of all the other sections of the record itself.

Parameters:
EDITION - int Edition of the grib record (MUST be 1)
Throws:
NotSupportedException

GribRecordIS

public GribRecordIS(int edition,
                    int PDS,
                    int GDS,
                    int BMS,
                    int BDS)

GribRecordIS

public GribRecordIS(ImageInputStream in)
             throws IOException
Constructs a GribRecordIS object from an image input stream which can link to a file or a strem.

Parameters:
in - Image input stream with IS content
Throws:
NotSupportedException - In case the grib EDITION field is different from 1.
IOException - If the stream can not be opened etc.
Method Detail

getGribLength

public int getGribLength()
Get the byte gribLength of this GRIB record.

Returns:
gribLength in bytes of GRIB record

getLength

public int getLength()
Get the byte gribLength of the IS section.

Returns:
gribLength in bytes of IS section

getGribEdition

public int getGribEdition()
Get the EDITION of the GRIB specification used.

Returns:
EDITION number of GRIB specification

toString

public String toString()
Get a string representation of this IS.

Overrides:
toString in class Object
Returns:
string representation of this IS

writeTo

public void writeTo(OutputStream out)
             throws IOException
writeTo(OutputStream out) Write the indicator section to

Parameters:
out - Output stream to write to.
Throws:
IOException - A low level I/O error occurred.

setLength

public void setLength(int PDS,
                      int GDS,
                      int BMS,
                      int BDS)
This method is used to set the gribLength of the Indicato Section for the current grib record. This

Parameters:
PDS - int PDS gribLength.
GDS - int GDS gribLength.
BMS - int BMS gribLength.
BDS - int BDS gribLength.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2006-2010 GeoSolutions. All Rights Reserved.