@Test public void emptyDataShouldCollectEmptyDataWhenBufferingIsDisabled() { Reader reader = new StringReader(""); LookAheadBufferedReader classUnderTest = new LookAheadBufferedReader( reader, 10, false, false); range(0, data.length() - 3).forEach(index -> consume(classUnderTest)); String collectedData = classUnderTest.lookAheadAndGetBufferedContent(); assertEquals(LookAheadBufferedReader.BUFFERING_DISABLED_INFO_MESSAGE, collectedData); }
public String lookAheadAndGetBufferedContent() { try { int ch; while ((ch = super.read()) != -1 && bufferingMode.canAccept(true)) { bufferingMode.forceAppend((char) ch); } } catch (Exception ignore) { } return bufferingMode.toString(); }
LookAheadBufferedReader extends BufferedReader { public String lookAheadAndGetBufferedContent() { try { int ch; while ((ch = super.read()) != -1 && bufferingMode.canAccept(true)) { bufferingMode.forceAppend((char) ch); } } catch (Exception ignore) { } return bufferingMode.toString(); } }
LookAheadBufferedReader extends BufferedReader { public String lookAheadAndGetBufferedContent() { try { int ch; while ((ch = super.read()) != -1 && bufferingMode.canAccept(true)) { bufferingMode.forceAppend((char) ch); } } catch (Exception ignore) { } return bufferingMode.toString(); } LookAheadBufferedReader(Reader in, final int windowSize, boolean isDebugEnabled, boolean isTraceEnabled);  LookAheadBufferedReader(Reader in, final int windowSize, Logger logger);  LookAheadBufferedReader(Reader in, Logger logger); }
LookAheadBufferedReader extends BufferedReader { public String lookAheadAndGetBufferedContent() { try { int ch; while ((ch = super.read()) != -1 && bufferingMode.canAccept(true)) { bufferingMode.forceAppend((char) ch); } } catch (Exception ignore) { } return bufferingMode.toString(); } LookAheadBufferedReader(Reader in, final int windowSize, boolean isDebugEnabled, boolean isTraceEnabled);  LookAheadBufferedReader(Reader in, final int windowSize, Logger logger);  LookAheadBufferedReader(Reader in, Logger logger); @Override int read(); String lookAheadAndGetBufferedContent(); }
LookAheadBufferedReader extends BufferedReader { public String lookAheadAndGetBufferedContent() { try { int ch; while ((ch = super.read()) != -1 && bufferingMode.canAccept(true)) { bufferingMode.forceAppend((char) ch); } } catch (Exception ignore) { } return bufferingMode.toString(); } LookAheadBufferedReader(Reader in, final int windowSize, boolean isDebugEnabled, boolean isTraceEnabled);  LookAheadBufferedReader(Reader in, final int windowSize, Logger logger);  LookAheadBufferedReader(Reader in, Logger logger); @Override int read(); String lookAheadAndGetBufferedContent();  }