ucar.nc2.iosp.bufr
Class MessageScanner

java.lang.Object
  extended by ucar.nc2.iosp.bufr.MessageScanner

public class MessageScanner
extends Object

Sequentially scans a BUFR file, extracts the messages.

Since:
May 9, 2008
Author:
caron

Field Summary
static int MAX_MESSAGE_SIZE
           
 
Constructor Summary
MessageScanner(RandomAccessFile raf)
           
MessageScanner(RandomAccessFile raf, long startPos)
           
 
Method Summary
 byte[] getMessageBytes(Message m)
           
 byte[] getMessageBytesFromLast(Message m)
           
 int getTotalMessages()
           
 int getTotalObs()
           
 boolean hasNext()
           
static boolean isValidFile(RandomAccessFile raf)
          is this a valid BUFR file.
 Message next()
           
 long writeCurrentMessage(WritableByteChannel out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_MESSAGE_SIZE

public static final int MAX_MESSAGE_SIZE
See Also:
Constant Field Values
Constructor Detail

MessageScanner

public MessageScanner(RandomAccessFile raf)
               throws IOException
Throws:
IOException

MessageScanner

public MessageScanner(RandomAccessFile raf,
                      long startPos)
               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

hasNext

public boolean hasNext()
                throws IOException
Throws:
IOException

next

public Message next()
             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


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.