Package ghidra.app.util.bin
Class FaultTolerantInputStream
java.lang.Object
java.io.InputStream
ghidra.app.util.bin.FaultTolerantInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An InputStream wrapper that suppresses any
IOExceptions thrown by the wrapped stream
and starts returning 0 value bytes for all subsequent reads.-
Constructor Summary
ConstructorsConstructorDescriptionFaultTolerantInputStream(InputStream delegate, long length, BiConsumer<String, Throwable> errorConsumer) Creates instance. -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
FaultTolerantInputStream
public FaultTolerantInputStream(InputStream delegate, long length, BiConsumer<String, Throwable> errorConsumer) Creates instance.- Parameters:
delegate-InputStreamto wraplength- expected length of the streamerrorConsumer- consumer that will accept errors, if null Msg.error() will be used
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-