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(RandomAccessFile raf)
MessageScanner(RandomAccessFile raf, long startPos, boolean useEmbeddedTables)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Message
getFirstDataMessage()
byte[]
getMessageBytes(Message m)
byte[]
getMessageBytesFromLast(Message m)
TableLookup
getTableLookup()
int
getTotalMessages()
int
getTotalObs()
boolean
hasNext()
static boolean
isValidFile(RandomAccessFile raf)
is this a valid BUFR file.Message
next()
void
reset()
long
writeCurrentMessage(WritableByteChannel out)
-
-
-
Constructor Detail
-
MessageScanner
public MessageScanner(RandomAccessFile raf) throws IOException
- Throws:
IOException
-
MessageScanner
public MessageScanner(RandomAccessFile raf, long startPos, boolean useEmbeddedTables) throws IOException
- Throws:
IOException
-
-
Method Detail
-
isValidFile
public static boolean isValidFile(RandomAccessFile raf) throws IOException
is 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
-
-