@Test public void validateStartsWithLongerThanLastToken() throws IOException { final byte[] inputData = "This is going to be a spectacular test\nThis is".getBytes(StandardCharsets.UTF_8); final byte[] startsWith = "This is going to be".getBytes(StandardCharsets.UTF_8); try (final InputStream is = new ByteArrayInputStream(inputData); final TextLineDemarcator demarcator = new TextLineDemarcator(is)) { final OffsetInfo first = demarcator.nextOffsetInfo(startsWith); assertNotNull(first); assertEquals(0, first.getStartOffset()); assertEquals(39, first.getLength()); assertEquals(1, first.getCrlfLength()); assertTrue(first.isStartsWithMatch()); final OffsetInfo second = demarcator.nextOffsetInfo(startsWith); assertNotNull(second); assertEquals(39, second.getStartOffset()); assertEquals(7, second.getLength()); assertEquals(0, second.getCrlfLength()); assertFalse(second.isStartsWithMatch()); } }
public OffsetInfo nextOffsetInfo() throws IOException { return this.nextOffsetInfo(null); }
TextLineDemarcator extends AbstractDemarcator { public OffsetInfo nextOffsetInfo() throws IOException { return this.nextOffsetInfo(null); } }
TextLineDemarcator extends AbstractDemarcator { public OffsetInfo nextOffsetInfo() throws IOException { return this.nextOffsetInfo(null); } TextLineDemarcator(InputStream is);  TextLineDemarcator(InputStream is, int initialBufferSize); }
TextLineDemarcator extends AbstractDemarcator { public OffsetInfo nextOffsetInfo() throws IOException { return this.nextOffsetInfo(null); } TextLineDemarcator(InputStream is);  TextLineDemarcator(InputStream is, int initialBufferSize); OffsetInfo nextOffsetInfo(); OffsetInfo nextOffsetInfo(byte[] startsWith); }
TextLineDemarcator extends AbstractDemarcator { public OffsetInfo nextOffsetInfo() throws IOException { return this.nextOffsetInfo(null); } TextLineDemarcator(InputStream is);  TextLineDemarcator(InputStream is, int initialBufferSize); OffsetInfo nextOffsetInfo(); OffsetInfo nextOffsetInfo(byte[] startsWith);  }