@Test public void startWithNoMatchOnWholeStream() throws Exception { InputStream is = stringToIs("oleg\rjoe\njack\r\nstacymike\r\n"); TextLineDemarcator demarcator = new TextLineDemarcator(is, 4); OffsetInfo offsetInfo = demarcator.nextOffsetInfo("foojhkj".getBytes()); assertEquals(0, offsetInfo.getStartOffset()); assertEquals(5, offsetInfo.getLength()); assertEquals(1, offsetInfo.getCrlfLength()); assertFalse(offsetInfo.isStartsWithMatch()); offsetInfo = demarcator.nextOffsetInfo("foo".getBytes()); assertEquals(5, offsetInfo.getStartOffset()); assertEquals(4, offsetInfo.getLength()); assertEquals(1, offsetInfo.getCrlfLength()); assertFalse(offsetInfo.isStartsWithMatch()); offsetInfo = demarcator.nextOffsetInfo("joe".getBytes()); assertEquals(9, offsetInfo.getStartOffset()); assertEquals(6, offsetInfo.getLength()); assertEquals(2, offsetInfo.getCrlfLength()); assertFalse(offsetInfo.isStartsWithMatch()); offsetInfo = demarcator.nextOffsetInfo("stasy".getBytes()); assertEquals(15, offsetInfo.getStartOffset()); assertEquals(11, offsetInfo.getLength()); assertEquals(2, offsetInfo.getCrlfLength()); assertFalse(offsetInfo.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);  }