Package com.luciad.format.asterix
Class TLcdASTERIXFinalReplayInputStream
java.lang.Object
java.io.InputStream
java.io.PipedInputStream
com.luciad.format.asterix.TLcdASTERIXFinalReplayInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
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 );
-
Field Summary
Fields inherited from class java.io.PipedInputStream
buffer, in, out, PIPE_SIZE
-
Constructor Summary
ConstructorDescriptionTLcdASTERIXFinalReplayInputStream
(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.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. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Returns the exception handler.void
setExceptionHandler
(ILcdExceptionHandler aExceptionHandler) Sets the exception handler.Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
TLcdASTERIXFinalReplayInputStream
Constructs a new TLcdASTERIXFinalReplayInputStream with a default buffer. It assumes the stream of data is in the ASTERIX final format, useTLcdASTERIXFinalReplayInputStream(java.io.InputStream, int, int)
to read PCAP.- Parameters:
aInputStream
-InputStream
that returns ASTERIX final binary format.- Throws:
IOException
- In case of IO errors.
-
TLcdASTERIXFinalReplayInputStream
public TLcdASTERIXFinalReplayInputStream(InputStream aInputStream, int aMaxBuffer) throws IOException Constructs a new TLcdASTERIXFinalReplayInputStream with a buffer of size aMaxBuffer. It assumes the stream of data is in the ASTERIX final format, useTLcdASTERIXFinalReplayInputStream(java.io.InputStream, int, int)
to read PCAP.- Parameters:
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.- Throws:
IOException
- In case of IO errors.
-
TLcdASTERIXFinalReplayInputStream
public TLcdASTERIXFinalReplayInputStream(InputStream aInputStream, int aMaxBuffer, int aFileFormat) throws IOException Constructs a new TLcdASTERIXFinalReplayInputStream with a buffer of size aMaxBuffer.- Parameters:
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, eitherTLcdASTERIXModelDecoder.ASTERIX_FINAL_FORMAT
(the default) orTLcdASTERIXModelDecoder.PCAP_FORMAT
.- Throws:
IOException
- In case of IO errors.
-
TLcdASTERIXFinalReplayInputStream
Constructs a new TLcdASTERIXFinalReplayInputStream that gets the data from the specified data source. The format of the data source is derived from its extension. Only data in theASTERIX_FINAL_FORMAT
or thePCAP_FORMAT
is supported.- Parameters:
aDataSource
- The data source containing the source names to replay. This must not benull
.- Throws:
IOException
- See Also:
-
TLcdASTERIXFinalReplayInputStream
public TLcdASTERIXFinalReplayInputStream(TLcdASTERIXDataSource aDataSource, ILcdInputStreamFactory aInputStreamFactory) throws IOException Constructs a new TLcdASTERIXFinalReplayInputStream that gets the data from the specified data source. The format of the data source is derived from its extension. Only data in theASTERIX_FINAL_FORMAT
or thePCAP_FORMAT
is supported.- Parameters:
aDataSource
- The data source containing the source names to replay. This must not benull
.aInputStreamFactory
- TheILcdInputStreamFactory
that will be used to createInputStreams
for the source names in the data source. This must not benull
. By default this is an instance ofTLcdInputStreamFactory
.- Throws:
IOException
- See Also:
-
TLcdASTERIXFinalReplayInputStream
public TLcdASTERIXFinalReplayInputStream(TLcdASTERIXDataSource aDataSource, ILcdInputStreamFactory aInputStreamFactory, int aMaxBuffer) throws IOException Constructs a new TLcdASTERIXFinalReplayInputStream that gets the data from the specified data source. The format of the data source is derived from its extension. Only data in theASTERIX_FINAL_FORMAT
or thePCAP_FORMAT
is supported.- Parameters:
aDataSource
- The data source containing the source names to replay. This must not benull
.aInputStreamFactory
- TheILcdInputStreamFactory
that will be used to createInputStreams
for the source names in the data source. This must not benull
. By default this is an instance ofTLcdInputStreamFactory
.aMaxBuffer
- The maximum of buffered items that are read but not yet released to read from this TLcdASTERIXFinalReplayInputStream. The default value is 20.- Throws:
IOException
- See Also:
-
-
Method Details
-
getExceptionHandler
Returns the exception handler.- Returns:
- the exception handler.
- See Also:
-
setExceptionHandler
Sets the exception handler. The exception handler is called whenever non recoverable exceptions occur. It can for example be used to pop up a dialog to inform the user about it.- Parameters:
aExceptionHandler
- The exception handler, must not be null.- See Also:
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classPipedInputStream
- Throws:
IOException
-