public class ExecutionDataWriter extends Object implements ISessionInfoVisitor, IExecutionDataVisitor
Modifier and Type | Field and Description |
---|---|
static byte |
BLOCK_EXECUTIONDATA
Block identifier for execution data of a single class.
|
static byte |
BLOCK_HEADER
Block identifier for file headers.
|
static byte |
BLOCK_SESSIONINFO
Block identifier for session information.
|
static char |
FORMAT_VERSION
File format version, will be incremented for each incompatible change.
|
static char |
MAGIC_NUMBER
Magic number in header for file format identification.
|
protected CompactDataOutput |
out
Underlying data output
|
Constructor and Description |
---|
ExecutionDataWriter(OutputStream output)
Creates a new writer based on the given output stream.
|
Modifier and Type | Method and Description |
---|---|
void |
flush()
Flushes the underlying stream.
|
static byte[] |
getFileHeader()
Returns the first bytes of a file that represents a valid execution data
file.
|
void |
visitClassExecution(ExecutionData data)
Provides execution data for a class.
|
void |
visitSessionInfo(SessionInfo info)
Provides session information for the subsequent execution data calls.
|
public static final char FORMAT_VERSION
public static final char MAGIC_NUMBER
public static final byte BLOCK_HEADER
public static final byte BLOCK_SESSIONINFO
public static final byte BLOCK_EXECUTIONDATA
protected final CompactDataOutput out
public ExecutionDataWriter(OutputStream output) throws IOException
output
- binary stream to write execution data toIOException
- if the header can't be writtenpublic void flush() throws IOException
IOException
- if the underlying stream can't be flushedpublic void visitSessionInfo(SessionInfo info)
ISessionInfoVisitor
visitSessionInfo
in interface ISessionInfoVisitor
info
- session informationpublic void visitClassExecution(ExecutionData data)
IExecutionDataVisitor
visitClassExecution
in interface IExecutionDataVisitor
data
- execution data for a classpublic static final byte[] getFileHeader()
0x01 0xC0 0xC0
.Copyright © 2021. All rights reserved.