Class FlowFileAccessInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.nifi.controller.repository.io.FlowFileAccessInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Wraps an InputStream so that if any IOException is thrown, it will be wrapped in a FlowFileAccessException. We do this to isolate IOExceptions thrown by the framework from those thrown by user code. If thrown by the framework, it generally indicates a problem communicating with the Content Repository and session rollback is often appropriate so that the FlowFile can be processed again.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate final ContentClaimprivate final FlowFileprivate ContentNotFoundExceptionFields inherited from class java.io.FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionFlowFileAccessInputStream(InputStream in, FlowFile flowFile, ContentClaim claim) -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
flowFile
-
claim
-
bytesConsumed
private long bytesConsumed -
thrown
-
-
Constructor Details
-
FlowFileAccessInputStream
-
-
Method Details
-
ensureAllContentRead
- Throws:
ContentNotFoundException
-
getContentNotFoundException
- Returns:
- the ContentNotFoundException that was thrown by this stream, or
nullif no such Exception was thrown
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
available
- Overrides:
availablein classFilterInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classFilterInputStream
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classFilterInputStream- Throws:
IOException
-
mark
public void mark(int n) - Overrides:
markin classFilterInputStream
-