public class FlowFileAccessInputStream extends FilterInputStream
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.
| Modifier and Type | Field and Description |
|---|---|
private long |
bytesConsumed |
private ContentClaim |
claim |
private FlowFile |
flowFile |
private ContentNotFoundException |
thrown |
in| Constructor and Description |
|---|
FlowFileAccessInputStream(InputStream in,
FlowFile flowFile,
ContentClaim claim) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
private void |
ensureAllContentRead() |
ContentNotFoundException |
getContentNotFoundException() |
void |
mark(int n) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
private final FlowFile flowFile
private final ContentClaim claim
private long bytesConsumed
private ContentNotFoundException thrown
public FlowFileAccessInputStream(InputStream in, FlowFile flowFile, ContentClaim claim)
private void ensureAllContentRead()
throws ContentNotFoundException
ContentNotFoundExceptionpublic ContentNotFoundException getContentNotFoundException()
null if no such Exception was thrownpublic int read()
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class FilterInputStreamIOExceptionpublic int available()
throws IOException
available in class FilterInputStreamIOExceptionpublic boolean markSupported()
markSupported in class FilterInputStreampublic long skip(long n)
throws IOException
skip in class FilterInputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterInputStreamIOExceptionpublic void reset()
throws IOException
reset in class FilterInputStreamIOExceptionpublic void mark(int n)
mark in class FilterInputStreamCopyright © 2021 Apache NiFi Project. All rights reserved.