Class ContentClaimInputStream
java.lang.Object
java.io.InputStream
org.apache.nifi.controller.repository.io.ContentClaimInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An InputStream that is provided a Content Repository, Content Claim, and offset into the Content Claim where a FlowFile's
content begins, and is capable of reading the content from the Content Repository, as well as providing the ability to use
mark(int)/reset() in order to re-read content without buffering it.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate InputStreamprivate longprivate final longprivate final ContentClaimprivate final ContentRepositoryprivate longprivate InputStreamprivate longprivate intprivate final PerformanceTracker -
Constructor Summary
ConstructorsConstructorDescriptionContentClaimInputStream(ContentRepository contentRepository, ContentClaim contentClaim, long claimOffset, InputStream initialDelegate, PerformanceTracker performanceTracker) ContentClaimInputStream(ContentRepository contentRepository, ContentClaim contentClaim, long claimOffset, PerformanceTracker performanceTracker) -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
contentRepository
-
contentClaim
-
claimOffset
private final long claimOffset -
performanceTracker
-
delegate
-
bytesConsumed
private long bytesConsumed -
currentOffset
private long currentOffset -
markOffset
private long markOffset -
bufferedIn
-
markReadLimit
private int markReadLimit
-
-
Constructor Details
-
ContentClaimInputStream
public ContentClaimInputStream(ContentRepository contentRepository, ContentClaim contentClaim, long claimOffset, PerformanceTracker performanceTracker) -
ContentClaimInputStream
public ContentClaimInputStream(ContentRepository contentRepository, ContentClaim contentClaim, long claimOffset, InputStream initialDelegate, PerformanceTracker performanceTracker)
-
-
Method Details
-
getDelegate
- Throws:
IOException
-
getBytesConsumed
public long getBytesConsumed() -
getCurrentOffset
public long getCurrentOffset() -
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
mark
public void mark(int readLimit) Marks the current position. Can be returned to withreset().- Overrides:
markin classInputStream- Parameters:
readLimit- hint on how much data should be buffered.- See Also:
-
reset
Resets to the last marked position.- Overrides:
resetin classInputStream- Throws:
IOException- Thrown when a mark position is not set or on other stream handling failures- See Also:
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
formDelegate
- Throws:
IOException
-