Package ucar.nc2.iosp.bufr
Class MessageScanner
- java.lang.Object
-
- ucar.nc2.iosp.bufr.MessageScanner
-
public class MessageScanner extends Object
Sequentially scans a BUFR file, extracts the messages.- Since:
- May 9, 2008
-
-
Constructor Summary
Constructors Constructor Description MessageScanner(ucar.unidata.io.RandomAccessFile raf)MessageScanner(ucar.unidata.io.RandomAccessFile raf, long startPos, boolean useEmbeddedTables)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MessagegetFirstDataMessage()byte[]getMessageBytes(Message m)byte[]getMessageBytesFromLast(Message m)TableLookupgetTableLookup()intgetTotalMessages()intgetTotalObs()booleanhasNext()static booleanisValidFile(ucar.unidata.io.RandomAccessFile raf)is this a valid BUFR file.Messagenext()voidreset()longwriteCurrentMessage(WritableByteChannel out)
-
-
-
Constructor Detail
-
MessageScanner
public MessageScanner(ucar.unidata.io.RandomAccessFile raf) throws IOException- Throws:
IOException
-
MessageScanner
public MessageScanner(ucar.unidata.io.RandomAccessFile raf, long startPos, boolean useEmbeddedTables) throws IOException- Throws:
IOException
-
-
Method Detail
-
isValidFile
public static boolean isValidFile(ucar.unidata.io.RandomAccessFile raf) throws IOExceptionis this a valid BUFR file.- Parameters:
raf- check this file- Returns:
- true if its a BUFR file
- Throws:
IOException- on read error
-
getFirstDataMessage
public Message getFirstDataMessage() throws IOException
- Throws:
IOException
-
reset
public void reset()
-
hasNext
public boolean hasNext() throws IOException- Throws:
IOException
-
next
public Message next()
-
getTableLookup
public TableLookup getTableLookup() throws IOException
- Throws:
IOException
-
getMessageBytesFromLast
public byte[] getMessageBytesFromLast(Message m) throws IOException
- Throws:
IOException
-
getMessageBytes
public byte[] getMessageBytes(Message m) throws IOException
- Throws:
IOException
-
getTotalObs
public int getTotalObs()
-
getTotalMessages
public int getTotalMessages()
-
writeCurrentMessage
public long writeCurrentMessage(WritableByteChannel out) throws IOException
- Throws:
IOException
-
-