Class TextLineDemarcator.OffsetInfo

java.lang.Object
org.apache.nifi.stream.io.util.TextLineDemarcator.OffsetInfo
Enclosing class:
TextLineDemarcator

public static class TextLineDemarcator.OffsetInfo extends Object
Container to hold offset and meta info for a computed text line. The offset and meta info is represented with the following 4 values:
  • startOffset - the offset in the overall stream which represents the beginning of the text line
  • length - length of the text line including CRLF characters
  • crlfLength - the length of the CRLF. Value 0 is returned if text line represents the last text line in the InputStream (i.e., EOF) and such line does not terminate with CR or LF or the combination of the two. Value 1 is returned if text line ends with '\n' or '\r'. Value 2 is returned if line ends with '\r\n').
  • startsWithMatch - true by default unless startWith bytes are provided and not matched. See TextLineDemarcator.nextOffsetInfo(byte[]) for more info.
  • Field Details

    • startOffset

      private final long startOffset
    • length

      private final long length
    • crlfLength

      private final int crlfLength
    • startsWithMatch

      private boolean startsWithMatch
  • Constructor Details

    • OffsetInfo

      private OffsetInfo(long startOffset, long length, int crlfLength)
  • Method Details

    • getStartOffset

      public long getStartOffset()
    • getLength

      public long getLength()
    • getCrlfLength

      public int getCrlfLength()
    • isStartsWithMatch

      public boolean isStartsWithMatch()
    • setStartsWithMatch

      void setStartsWithMatch(boolean startsWithMatch)
    • toString

      public String toString()
      Overrides:
      toString in class Object