Package org.apache.nifi.stream.io.util
Class AbstractTextDemarcator
java.lang.Object
org.apache.nifi.stream.io.util.AbstractTextDemarcator
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
LineDemarcator
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int(package private) char[](package private) intprivate static final int(package private) intprivate final intprivate final Reader -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTextDemarcator(Reader reader, int maxDataSize) Constructs an instance of demarcator with providedInputStreamand max buffer size.AbstractTextDemarcator(Reader reader, int maxDataSize, int initialBufferSize) Constructs an instance of demarcator with providedInputStreamand max buffer size and initial buffer size. -
Method Summary
-
Field Details
-
INIT_BUFFER_SIZE
private static final int INIT_BUFFER_SIZE- See Also:
-
reader
-
maxDataSize
private final int maxDataSize -
buffer
char[] buffer -
index
int index -
mark
int mark -
availableBytesLength
int availableBytesLength
-
-
Constructor Details
-
AbstractTextDemarcator
AbstractTextDemarcator(Reader reader, int maxDataSize) Constructs an instance of demarcator with providedInputStreamand max buffer size. Each demarcated token must fit within max buffer size, otherwise the exception will be raised. -
AbstractTextDemarcator
AbstractTextDemarcator(Reader reader, int maxDataSize, int initialBufferSize) Constructs an instance of demarcator with providedInputStreamand max buffer size and initial buffer size. Each demarcated token must fit within max buffer size, otherwise the exception will be raised.
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
fill
Will fill the current buffer from current 'index' position, expanding it and or shuffling it if necessary. If buffer exceeds max buffer size aBufferOverflowExceptionwill be thrown.- Throws:
IOException- if unable to read from the stream
-
validate
Validates prerequisites for constructor arguments
-