Class TLcdASDIFileReplayInputStream

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

public class TLcdASDIFileReplayInputStream extends PipedInputStream
This InputStream replays a recorded ASDI message feed. It provides ASDI messages with timing intervals equal to those that actually occurred during the recording. The InputStream thus mimics the actual timings of the messages except that the start time is set approximately to the creation time of the TLcdASDIFileReplayInputStream.

The timing information is derived from the headers of the ASDI messages.

  • Constructor Details

    • TLcdASDIFileReplayInputStream

      public TLcdASDIFileReplayInputStream(InputStream aInputStream) throws IOException
      Constructs a new TLcdASDIFileReplayInputStream with a default buffer.
      Parameters:
      aInputStream - the InputStream for reading messages from.
      Throws:
      IOException - In case of IO failure.
    • TLcdASDIFileReplayInputStream

      public TLcdASDIFileReplayInputStream(InputStream aInputStream, int aMaxBuffer) throws IOException
      Constructs a new TLcdASDIFileReplayInputStream with a buffer of size aMaxBuffer.
      Parameters:
      aInputStream - the InputStream for reading messages from.
      aMaxBuffer - The maximum of buffered items that are read but not yet released to read from this TLcdASDIFileReplayInputStream.
      Throws:
      IOException - In case of IO failure.
  • Method Details

    • setClassTraceOn

      public static void setClassTraceOn(boolean aClassTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for all instances of this class. If the argument is true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
      Parameters:
      aClassTraceOn - if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
    • isClassTraceOn

      public static boolean isClassTraceOn()
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Returns true if tracing is enabled for this class.
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • getExceptionHandler

      public ILcdExceptionHandler getExceptionHandler()
      Returns the exception handler.
      Returns:
      the exception handler.
      See Also:
    • setExceptionHandler

      public void setExceptionHandler(ILcdExceptionHandler aExceptionHandler)
      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.
    • close

      public void close() throws IOException

      Closes the file replay input stream and releases any resources associated with it. If it was in the middle of reading ASDI messages from the input stream, the reading will be stopped first. The pending tasks scheduled for providing the ASDI messages will be cancelled.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class PipedInputStream
      Throws:
      IOException - if an I/O error occurs.