Package org.deltafi.common.nifi
Class FlowFileInputStream
java.lang.Object
java.io.InputStream
java.io.PipedInputStream
org.deltafi.common.io.WriterPipedInputStream
org.deltafi.common.nifi.FlowFileInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An InputStream providing a FlowFile for supplied content and attributes that is written in a separate thread.
-
Field Summary
Fields inherited from class java.io.PipedInputStream
buffer, in, out, PIPE_SIZE -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static FlowFileInputStreamcreate(InputStream inputStream, Map<String, String> attributes, long fileSize, ExecutorService executorService) Creates a FlowFileInputStream that packages the content in the provided InputStream with the supplied attributes in a FlowFile V1, starting a separate thread for writing.static FlowFileInputStreamcreate(org.apache.nifi.util.FlowFilePackager flowFilePackager, InputStream inputStream, Map<String, String> attributes, long fileSize, ExecutorService executorService) Creates a FlowFileInputStream that packages the content in the provided InputStream with the supplied attributes using the supplied FlowFilePackager, starting a separate thread for writing.Methods inherited from class org.deltafi.common.io.WriterPipedInputStream
create, create, runPipeWriterMethods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Method Details
-
create
public static FlowFileInputStream create(InputStream inputStream, Map<String, String> attributes, long fileSize, ExecutorService executorService) throws IOExceptionCreates a FlowFileInputStream that packages the content in the provided InputStream with the supplied attributes in a FlowFile V1, starting a separate thread for writing.- Parameters:
inputStream- the InputStream containing the contentattributes- the Map of attributes to includefileSize- the size of the contentexecutorService- the ExecutorService used to submit the writing thread- Returns:
- the FlowFileInputStream
- Throws:
IOException- if an I/O error occurs
-
create
public static FlowFileInputStream create(org.apache.nifi.util.FlowFilePackager flowFilePackager, InputStream inputStream, Map<String, String> attributes, long fileSize, ExecutorService executorService) throws IOExceptionCreates a FlowFileInputStream that packages the content in the provided InputStream with the supplied attributes using the supplied FlowFilePackager, starting a separate thread for writing.- Parameters:
flowFilePackager- the FlowFilePackager used to package the content and attributesinputStream- the InputStream containing the contentattributes- the Map of attributes to includefileSize- the size of the contentexecutorService- the ExecutorService used to submit the writing thread- Returns:
- the FlowFileInputStream
- Throws:
IOException- if an I/O error occurs
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classWriterPipedInputStream- Throws:
IOException
-