public class TLcdASDIFileReplayInputStream extends PipedInputStream
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.buffer, in, out, PIPE_SIZE
Constructor and Description |
---|
TLcdASDIFileReplayInputStream(InputStream aInputStream)
Constructs a new
TLcdASDIFileReplayInputStream with a default buffer. |
TLcdASDIFileReplayInputStream(InputStream aInputStream,
int aMaxBuffer)
Constructs a new
TLcdASDIFileReplayInputStream with a buffer of size aMaxBuffer . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the file replay input stream and releases any resources associated with it.
|
ILcdExceptionHandler |
getExceptionHandler()
Returns the exception handler.
|
static boolean |
isClassTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setExceptionHandler(ILcdExceptionHandler aExceptionHandler)
Sets the exception handler.
|
mark, markSupported, read, reset, skip
public TLcdASDIFileReplayInputStream(InputStream aInputStream) throws IOException
TLcdASDIFileReplayInputStream
with a default buffer.aInputStream
- the InputStream
for reading messages from.IOException
- In case of IO failure.public TLcdASDIFileReplayInputStream(InputStream aInputStream, int aMaxBuffer) throws IOException
TLcdASDIFileReplayInputStream
with a buffer of size aMaxBuffer
.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
.IOException
- In case of IO failure.public static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.public static boolean isClassTraceOn()
true
if tracing is enabled for this class.public ILcdExceptionHandler getExceptionHandler()
setExceptionHandler(com.luciad.util.ILcdExceptionHandler)
public void setExceptionHandler(ILcdExceptionHandler aExceptionHandler)
aExceptionHandler
- The exception handler, must not be null.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.
close
in interface Closeable
close
in interface AutoCloseable
close
in class PipedInputStream
IOException
- if an I/O error occurs.