Code example for BufferedReader

Methods: closereadLine

0
  } 
 
  private void assertReadText(Path f) throws Exception {
    InputStream ir = StreamUtils.inputStream(f);
    InputStreamReader in = new InputStreamReader(ir, StandardCharsets.UTF_8);
    BufferedReader r = new BufferedReader(in);
    String line = r.readLine();
    assertEquals("Wrong text found in "+f.getFileName(), TEXT, line);
    r.close();
  } 
   
  @Override 
  @Before 
  public void setUp() throws Exception {
    super.setUp(); 
    testDir = getWorkDir().resolve("ContentSourceTest");
    IOUtils.rm(testDir);
    Files.createDirectory(testDir);
  }