public class Log
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Log.Event
Represents a single received LCM message.
|
Constructor and Description |
---|
Log(java.lang.String path,
java.lang.String mode)
Opens a log file for reading or writing.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the log file and releases and system resources used by it.
|
java.lang.String |
getPath()
Retrieves the path to the log file.
|
double |
getPositionFraction() |
Log.Event |
readNext()
Reads the next event in the log file
|
void |
seekPositionFraction(double frac)
Seek to a position in the log file, specified by a fraction.
|
void |
write(Log.Event e)
Writes an event to the log file.
|
void |
write(long utime,
java.lang.String channel,
LCMEncodable msg)
A convenience method for write.
|
public Log(java.lang.String path, java.lang.String mode) throws java.io.IOException
path
- the filename to openmode
- Specifies the access mode, must be one of "r", "rw",
"rws", or "rwd". See RandomAccessFile
for more detail.java.io.IOException
public java.lang.String getPath()
public Log.Event readNext() throws java.io.IOException
java.io.EOFException
- if the end of the file has been reached.java.io.IOException
public double getPositionFraction() throws java.io.IOException
java.io.IOException
public void seekPositionFraction(double frac) throws java.io.IOException
frac
- a number in the range [0, 1)java.io.IOException
public void write(Log.Event e) throws java.io.IOException
java.io.IOException
public void write(long utime, java.lang.String channel, LCMEncodable msg) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException