Class TLcdASTERIXFinalReplayInputStream

java.lang.Object
java.io.InputStream
java.io.PipedInputStream
com.luciad.format.asterix.TLcdASTERIXFinalReplayInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

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 );
 
  • Constructor Details

    • TLcdASTERIXFinalReplayInputStream

      public TLcdASTERIXFinalReplayInputStream(InputStream aInputStream) throws IOException
      Constructs a new TLcdASTERIXFinalReplayInputStream with a default buffer. It assumes the stream of data is in the ASTERIX final format, use TLcdASTERIXFinalReplayInputStream(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, use TLcdASTERIXFinalReplayInputStream(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, either TLcdASTERIXModelDecoder.ASTERIX_FINAL_FORMAT (the default) or TLcdASTERIXModelDecoder.PCAP_FORMAT.
      Throws:
      IOException - In case of IO errors.
    • TLcdASTERIXFinalReplayInputStream

      public TLcdASTERIXFinalReplayInputStream(TLcdASTERIXDataSource aDataSource) 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 the ASTERIX_FINAL_FORMAT or the PCAP_FORMAT is supported.
      Parameters:
      aDataSource - The data source containing the source names to replay. This must not be null.
      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 the ASTERIX_FINAL_FORMAT or the PCAP_FORMAT is supported.
      Parameters:
      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.
      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 the ASTERIX_FINAL_FORMAT or the PCAP_FORMAT is supported.
      Parameters:
      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.
      Throws:
      IOException
      See Also:
  • Method Details