类 BufrDataInfo
- java.lang.Object
-
- org.meteoinfo.data.meteodata.bufr.BufrDataInfo
-
public class BufrDataInfo extends Object
- 作者:
- Yaqiang Wang
-
-
字段概要
字段 修饰符和类型 字段 说明 protected static int[]BIT_MASK
-
构造器概要
构造器 构造器 说明 BufrDataInfo()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidcloseDataFile()Close the data file created by previos stepvoidcreateDataFile(String fileName)Create Bufr binary data fileucar.nc2.iosp.bufr.MessagereadFirstMessage(String fileName)Read first messageList<ucar.nc2.iosp.bufr.Message>readMessages(String fileName)Read MessagesvoidreWriteDataSectionHead(int len)Write data section headvoidreWriteIndicatorSection(int bufrLength, int edition)Write indicator sectionprotected static voidsetBit(int bit, byte[] bytes)byte[]toByteArray(BitSet bs)intwrite(int value, int nbits)Write a int valueintwrite(String des, int value)Write a int valueintwrite(List<Integer> values, List<Integer> nbits)Write int valuesintwriteDataDescriptionSection(int ndatasets, int datatype, List<String> descriptors)Write data description sectionintwriteDataSectionHead(int len)Write data section headintwriteEndSection()Write end sectionintwriteIdentificationSection(int len, int master_table, int subcenter_id, int center_id, int update_sequence, int optional, int category, int sub_category, int master_table_version, int local_table_version, int year, int month, int day, int hour, int minute)Write identification sectionintwriteIndicatorSection(int bufrLength, int edition)Write indicator section
-
-
-
方法详细资料
-
readFirstMessage
public ucar.nc2.iosp.bufr.Message readFirstMessage(String fileName) throws FileNotFoundException, IOException
Read first message- 参数:
fileName- Bufr File Name- 返回:
- First message
- 抛出:
FileNotFoundExceptionIOException
-
readMessages
public List<ucar.nc2.iosp.bufr.Message> readMessages(String fileName) throws IOException
Read Messages- 参数:
fileName- Bufr file name- 返回:
- Messages
- 抛出:
IOException
-
createDataFile
public void createDataFile(String fileName)
Create Bufr binary data file- 参数:
fileName- File name
-
closeDataFile
public void closeDataFile()
Close the data file created by previos step
-
writeIndicatorSection
public int writeIndicatorSection(int bufrLength, int edition) throws IOExceptionWrite indicator section- 参数:
bufrLength- The total length of the messageedition- Bufr edition- 返回:
- Indicator section length
- 抛出:
IOException
-
reWriteIndicatorSection
public void reWriteIndicatorSection(int bufrLength, int edition) throws IOExceptionWrite indicator section- 参数:
bufrLength- The total length of the messageedition- Bufr edition- 抛出:
IOException
-
writeIdentificationSection
public int writeIdentificationSection(int len, int master_table, int subcenter_id, int center_id, int update_sequence, int optional, int category, int sub_category, int master_table_version, int local_table_version, int year, int month, int day, int hour, int minute) throws IOExceptionWrite identification section- 参数:
len- Section lengthmaster_table- Master tablesubcenter_id- Subcenter idcenter_id- Center idupdate_sequence- Update sequencyoptional- Optionalcategory- Categorysub_category- Sub categorymaster_table_version- Master table versionlocal_table_version- Local table versionyear- Yearmonth- Monthday- Dayhour- Hourminute- Minute- 返回:
- Section length
- 抛出:
IOException
-
writeDataDescriptionSection
public int writeDataDescriptionSection(int ndatasets, int datatype, List<String> descriptors) throws IOExceptionWrite data description section- 参数:
ndatasets- Number of datasetsdatatype- Data typedescriptors- Data descriptors- 返回:
- Section length
- 抛出:
IOException
-
writeDataSectionHead
public int writeDataSectionHead(int len) throws IOExceptionWrite data section head- 参数:
len- Length- 返回:
- Data section head length
- 抛出:
IOException
-
reWriteDataSectionHead
public void reWriteDataSectionHead(int len) throws IOExceptionWrite data section head- 参数:
len- Length- 抛出:
IOException
-
write
public int write(int value, int nbits) throws IOExceptionWrite a int value- 参数:
value- Valuenbits- bit number- 返回:
- Data length
- 抛出:
IOException
-
write
public int write(String des, int value) throws IOException
Write a int value- 参数:
value- Valuedes- Data descriptor string- 返回:
- Data length
- 抛出:
IOException
-
write
public int write(List<Integer> values, List<Integer> nbits) throws IOException
Write int values- 参数:
values- Valuesnbits- bit numbers- 返回:
- Data length
- 抛出:
IOException
-
toByteArray
public byte[] toByteArray(BitSet bs)
-
setBit
protected static void setBit(int bit, byte[] bytes)
-
writeEndSection
public int writeEndSection() throws IOExceptionWrite end section- 返回:
- End section length
- 抛出:
IOException
-
-