Class TextLineDemarcator

java.lang.Object
org.apache.nifi.stream.io.util.AbstractDemarcator
org.apache.nifi.stream.io.util.TextLineDemarcator
All Implemented Interfaces:
Closeable, AutoCloseable

public class TextLineDemarcator extends AbstractDemarcator
Implementation of demarcator of text lines in the provided InputStream. It works similar to the BufferedReader and its BufferedReader.readLine() methods except that it does not create a String representing the text line and instead returns the offset info for the computed text line. See nextOffsetInfo() and nextOffsetInfo(byte[]) for more details.

NOTE: Not intended for multi-thread usage hence not Thread-safe.

  • Field Details

    • CR

      private static int CR
    • LF

      private static int LF
  • Constructor Details

    • TextLineDemarcator

      public TextLineDemarcator(InputStream is)
      Constructs an instance of demarcator with provided InputStream and default buffer size.
    • TextLineDemarcator

      public TextLineDemarcator(InputStream is, int initialBufferSize)
      Constructs an instance of demarcator with provided InputStream and initial buffer size.
  • Method Details