com.antelmann.util.logging
Class BinaryFileLog
java.lang.Object
com.antelmann.util.logging.AbstractLogWriter<byte[]>
com.antelmann.util.logging.BinaryFileLog
- All Implemented Interfaces:
- Filter<LogEntry>, LogWriter
public class BinaryFileLog
- extends AbstractLogWriter<byte[]>
A LogWriter that logs the entries synchronously serialized to a file.
The implementation utilizes a BinaryLogFormatter.
To read from a BinaryFileLog, you can also use the ObjectEnumerator from
the class com.antelmann.io.MyFile.
Note that if the BinaryFileLog was initialized with either the option
keepConnectionAlive set to false or the option append set to true,
the individual log entries are separately serialized and written as byte[];
so if you want to recover the LogEntry objects, you'll need to deserialize then.
For the deserialization, you can use the com.antelmann.io.Data class.
- Since:
- 12/22/2002
- Author:
- Holger Antelmann
- See Also:
BinaryLogFormatter,
MyFile.objectEnumerator(boolean),
Data.deserialize(byte[])
|
Constructor Summary |
BinaryFileLog(File file,
boolean keepConnectionAlive,
boolean append)
|
|
Method Summary |
void |
close()
|
protected void |
finalize()
|
void |
writeLogPattern(byte[] pattern)
writes the complete serialized information and flushes synchronously |
BinaryFileLog
public BinaryFileLog(File file,
boolean keepConnectionAlive,
boolean append)
throws IOException
- Throws:
IOException
writeLogPattern
public void writeLogPattern(byte[] pattern)
throws LogException
- writes the complete serialized information and flushes synchronously
- Specified by:
writeLogPattern in class AbstractLogWriter<byte[]>
- Throws:
LogException
close
public void close()
throws IOException
- Throws:
IOException
finalize
protected void finalize()
throws IOException
- Overrides:
finalize in class Object
- Throws:
IOException
(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads