public class TLcdASTERIXFinalReplayInputStream extends PipedInputStream
TLcdASTERIXFinalReplayInputStream
replays a recorded ASTERIX Final input stream or a
recorded PCAP stream and provides plain ASTERIX messages with timing intervals equal to those
that actually occurred during the recording. The input stream thus mimics the actual timings of
the messages except that the start time is set approximately to the creation time of the input
stream. The file format has to be explicitly defined when using PCAP, otherwise ASTERIX Final is
assumed.
The timing information is derived from the headers of the ASTERIX Final format or the PCAP format.
An TLcdASTERIXFinalReplayInputStream
is typically used in combination with a live decoder:
InputStream stream = new TLcdInputStreamFactory().createInputStream( fileName );
TLcdASTERIXFinalReplayInputStream replayStream =
new TLcdASTERIXFinalReplayInputStream( stream, 20, TLcdASTERIXModelDecoder.ASTERIX_FINAL_FORMAT );
TLcdModelList modelListSFCT = ...;
TLcdASTERIXLiveDecoder liveDecoder = new TLcdASTERIXLiveDecoder();
liveDecoder.decodeSFCT( replayStream, ILcdFireEventMode.FIRE_NOW, modelListSFCT );
buffer, in, out, PIPE_SIZE
Constructor and Description |
---|
TLcdASTERIXFinalReplayInputStream(InputStream aInputStream)
Constructs a new TLcdASTERIXFinalReplayInputStream with a default buffer.
|
TLcdASTERIXFinalReplayInputStream(InputStream aInputStream,
int aMaxBuffer)
Constructs a new TLcdASTERIXFinalReplayInputStream with a buffer of size aMaxBuffer.
|
TLcdASTERIXFinalReplayInputStream(InputStream aInputStream,
int aMaxBuffer,
int aFileFormat)
Constructs a new TLcdASTERIXFinalReplayInputStream with a buffer of size aMaxBuffer.
|
TLcdASTERIXFinalReplayInputStream(TLcdASTERIXDataSource aDataSource)
Constructs a new TLcdASTERIXFinalReplayInputStream that gets the data from the specified data source.
|
TLcdASTERIXFinalReplayInputStream(TLcdASTERIXDataSource aDataSource,
ILcdInputStreamFactory aInputStreamFactory)
Constructs a new TLcdASTERIXFinalReplayInputStream that gets the data from the specified data source.
|
TLcdASTERIXFinalReplayInputStream(TLcdASTERIXDataSource aDataSource,
ILcdInputStreamFactory aInputStreamFactory,
int aMaxBuffer)
Constructs a new TLcdASTERIXFinalReplayInputStream that gets the data from the specified data source.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
ILcdExceptionHandler |
getExceptionHandler()
Returns the exception handler.
|
void |
setExceptionHandler(ILcdExceptionHandler aExceptionHandler)
Sets the exception handler.
|
mark, markSupported, read, reset, skip
public TLcdASTERIXFinalReplayInputStream(InputStream aInputStream) throws IOException
TLcdASTERIXFinalReplayInputStream(java.io.InputStream, int, int)
to read PCAP.aInputStream
- InputStream
that returns ASTERIX final binary format.IOException
- In case of IO errors.public TLcdASTERIXFinalReplayInputStream(InputStream aInputStream, int aMaxBuffer) throws IOException
TLcdASTERIXFinalReplayInputStream(java.io.InputStream, int, int)
to read PCAP.aInputStream
- InputStream
that returns ASTERIX final binary format.aMaxBuffer
- The maximum of buffered items that are read but not yet released to read from
this TLcdASTERIXFinalReplayInputStream. The default value is 20.IOException
- In case of IO errors.public TLcdASTERIXFinalReplayInputStream(InputStream aInputStream, int aMaxBuffer, int aFileFormat) throws IOException
aInputStream
- InputStream
that returns either ASTERIX final binary format,
or PCAP format (see below).aMaxBuffer
- The maximum of buffered items that are read but not yet released to read from
this TLcdASTERIXFinalReplayInputStream. The default value is 20.aFileFormat
- The format of the input stream, either TLcdASTERIXModelDecoder.ASTERIX_FINAL_FORMAT
(the default) or TLcdASTERIXModelDecoder.PCAP_FORMAT
.IOException
- In case of IO errors.public TLcdASTERIXFinalReplayInputStream(TLcdASTERIXDataSource aDataSource) throws IOException
ASTERIX_FINAL_FORMAT
or the
PCAP_FORMAT
is supported.aDataSource
- The data source containing the source names to replay. This must not be null
.IOException
TLcdASTERIXModelDecoder.decodeSource(com.luciad.model.ILcdDataSource)
public TLcdASTERIXFinalReplayInputStream(TLcdASTERIXDataSource aDataSource, ILcdInputStreamFactory aInputStreamFactory) throws IOException
ASTERIX_FINAL_FORMAT
or the
PCAP_FORMAT
is supported.aDataSource
- The data source containing the source names to replay. This must not be
null
.aInputStreamFactory
- The ILcdInputStreamFactory
that will be used to create
InputStreams
for the source names in the data source. This must not be
null
. By default this is an instance of TLcdInputStreamFactory
.IOException
TLcdASTERIXModelDecoder.decodeSource(com.luciad.model.ILcdDataSource)
public TLcdASTERIXFinalReplayInputStream(TLcdASTERIXDataSource aDataSource, ILcdInputStreamFactory aInputStreamFactory, int aMaxBuffer) throws IOException
ASTERIX_FINAL_FORMAT
or the
PCAP_FORMAT
is supported.aDataSource
- The data source containing the source names to replay. This must not be
null
.aInputStreamFactory
- The ILcdInputStreamFactory
that will be used to create
InputStreams
for the source names in the data source. This must not be
null
. By default this is an instance of TLcdInputStreamFactory
.aMaxBuffer
- The maximum of buffered items that are read but not yet released to read from this
TLcdASTERIXFinalReplayInputStream. The default value is 20.IOException
TLcdASTERIXModelDecoder.decodeSource(com.luciad.model.ILcdDataSource)
public ILcdExceptionHandler getExceptionHandler()
setExceptionHandler(com.luciad.util.ILcdExceptionHandler)
public void setExceptionHandler(ILcdExceptionHandler aExceptionHandler)
aExceptionHandler
- The exception handler, must not be null.getExceptionHandler()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class PipedInputStream
IOException