public class PackedFileReader
extends java.lang.Object
| Constructor and Description |
|---|
PackedFileReader(NMLMessageDictionary _dict,
boolean _l64_mode)
Create a PackedFileReader for reading log files of a given set of types.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
convertMsgToString(NMLmsg inMsg)
Use FormatConverter to get a string representation of the message.
|
java.util.List<LogTimeEntry> |
createLogTimeEntryList(java.io.File combinedFile,
java.io.File indexFile,
boolean indexIsLittleEndian,
int maxlen,
MsgToTimeStamp mtts)
Create a list to use as an index into a large ".COMBINED" file with
multiple messages in it using the ".index" file created by the
logRecorder at the same time
|
static void |
main(java.lang.String[] args) |
NMLmsg |
ReadFile(java.io.File f)
Read the entire message in the pointed to file and convert it to an
NMLmsg.
|
NMLmsg |
ReadFile(java.lang.String fileName)
Read the entire file or URL and parse it into an NMLmsg of the
appropriate type.
|
NMLmsg |
ReadFileNameStringMaxlen(java.lang.String fileName,
int maxlen)
Read the first maxlen bytes out of a file and convert it to an NMLmsg.
|
NMLmsg |
ReadFileObjectMaxLen(java.io.File f,
int max_len)
Read the first max_len bytes from a file and convert it to an NML
message.
|
NMLmsg |
ReadFileSection(java.io.File f,
int offset,
int max_len)
Read a message from a large ".COMBINED" file that contains multiple
messages.
|
NMLmsg |
ReadFileSection(java.lang.String fileName,
int offset,
int maxlen)
Read a section of a large file containing many messages.
|
static int[] |
ReadIndexes(java.io.File indexFile,
boolean littleEndian)
Read an indexFile as created by the logRecorder into an integer array.
|
static int[] |
ReadIndexes(java.lang.String indexFileName,
boolean littleEndian)
Read an indexFile as created by the logRecorder into an integer array.
|
public PackedFileReader(NMLMessageDictionary _dict, boolean _l64_mode)
_dict - MessageDictionary with auto-generated format functions to
parse this specific file types._l64_mode - should longs be stored or expected to be 64-bit instead
of 32-bitpublic NMLmsg ReadFile(java.lang.String fileName) throws java.io.FileNotFoundException
fileName - the path to a file, or a filename in the current
directory or a URL beginning with "http://"java.io.FileNotFoundExceptionpublic NMLmsg ReadFileNameStringMaxlen(java.lang.String fileName, int maxlen) throws java.io.FileNotFoundException
fileName - fileName or path or URL to read.maxlen - number of bytes to actually read.java.io.FileNotFoundExceptionpublic NMLmsg ReadFileSection(java.lang.String fileName, int offset, int maxlen) throws java.lang.Exception
fileName - filename or path to file or URL starting with "http://"offset - number of bytes from beginning of file to location of the
desired messagemaxlen - maximum number of bytes in the messagejava.lang.Exception - throws exception of offset or max_len exceeds the size
of file orpublic NMLmsg ReadFile(java.io.File f) throws java.io.FileNotFoundException
f - the file to read.java.io.FileNotFoundExceptionpublic NMLmsg ReadFileObjectMaxLen(java.io.File f, int max_len) throws java.io.FileNotFoundException
f - file to readmax_len - maximum number of bytes to read.java.io.FileNotFoundExceptionpublic static int[] ReadIndexes(java.lang.String indexFileName,
boolean littleEndian)
throws java.lang.Exception
indexFileName - name of the index file.littleEndian - was the log recorder run on a littleEndian platform
(probably true)java.lang.Exception - occurs if the file does not exist or can not be read.public static int[] ReadIndexes(java.io.File indexFile,
boolean littleEndian)
throws java.lang.Exception
indexFile - file to readlittleEndian - was the log recorder run on a littleEndian platform
(probably true)java.lang.Exception - occurs if the file does not exist or can not be read.public java.util.List<LogTimeEntry> createLogTimeEntryList(java.io.File combinedFile, java.io.File indexFile, boolean indexIsLittleEndian, int maxlen, MsgToTimeStamp mtts) throws java.lang.Exception
combinedFile - large file with multiple messages to readindexFile - index file with list of position offsets onlyindexIsLittleEndian - true if the logRecorder was run on a
little-endian platformmaxlen - number of bytes of each message that needs to be read to
get the time stamp.mtts - class to get timestamp out of custom message types.java.lang.Exception - are thrown if one of files does not exist or is not
readable.public static void main(java.lang.String[] args)
public NMLmsg ReadFileSection(java.io.File f, int offset, int max_len) throws java.lang.Exception
f - file to readoffset - offset in bytes to the desired messagemax_len - number of bytes to read from desired messagejava.lang.Exception - throws exception of offset or max_len exceeds the size
of file or file is not readable.public java.lang.String convertMsgToString(NMLmsg inMsg)
inMsg - message to convert