Package com.luciad.format.asdi
Class TLcdASDIFileReplayInputStream
java.lang.Object
java.io.InputStream
java.io.PipedInputStream
com.luciad.format.asdi.TLcdASDIFileReplayInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
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.-
Field Summary
Fields inherited from class java.io.PipedInputStream
buffer, in, out, PIPE_SIZE
-
Constructor Summary
ConstructorDescriptionTLcdASDIFileReplayInputStream
(InputStream aInputStream) Constructs a newTLcdASDIFileReplayInputStream
with a default buffer.TLcdASDIFileReplayInputStream
(InputStream aInputStream, int aMaxBuffer) Constructs a newTLcdASDIFileReplayInputStream
with a buffer of sizeaMaxBuffer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the file replay input stream and releases any resources associated with it.Returns the exception handler.static boolean
Deprecated.This method has been deprecated.static void
setClassTraceOn
(boolean aClassTraceOn) Deprecated.This method has been deprecated.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
-
TLcdASDIFileReplayInputStream
Constructs a newTLcdASDIFileReplayInputStream
with a default buffer.- Parameters:
aInputStream
- theInputStream
for reading messages from.- Throws:
IOException
- In case of IO failure.
-
TLcdASDIFileReplayInputStream
Constructs a newTLcdASDIFileReplayInputStream
with a buffer of sizeaMaxBuffer
.- Parameters:
aInputStream
- theInputStream
for reading messages from.aMaxBuffer
- The maximum of buffered items that are read but not yet released to read from thisTLcdASDIFileReplayInputStream
.- 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 istrue
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.Returnstrue
if tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
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.
-
close
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 interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classPipedInputStream
- Throws:
IOException
- if an I/O error occurs.
-