public class LineDemarcator extends AbstractTextDemarcator
ABC\rXYZ\nABCXYZ\r\nhello
Then calls to nextLine() will result in 4 String values being returned:
ABC\rXYZ\nABCXYZ\r\nhellonextLine() will return null.| Modifier and Type | Field and Description |
|---|---|
private static char |
CARRIAGE_RETURN |
private char |
lastChar |
private static char |
NEW_LINE |
availableBytesLength, buffer, index, mark| Constructor and Description |
|---|
LineDemarcator(InputStream in,
Charset charset,
int maxDataSize,
int initialBufferSize) |
LineDemarcator(Reader reader,
int maxDataSize,
int initialBufferSize) |
| Modifier and Type | Method and Description |
|---|---|
String |
nextLine()
Will read the next line of text from the
InputStream returning null
when it reaches the end of the stream. |
close, fillprivate static final char CARRIAGE_RETURN
private static final char NEW_LINE
private char lastChar
public LineDemarcator(InputStream in, Charset charset, int maxDataSize, int initialBufferSize)
public LineDemarcator(Reader reader, int maxDataSize, int initialBufferSize)
public String nextLine() throws IOException
InputStream returning null
when it reaches the end of the stream.IOException - if unable to read from the streamCopyright © 2023 Apache NiFi Project. All rights reserved.