Why is BufferedReader read() much slower than readLine()?
问题 I need to read a file one character at a time and I'm using the read() method from BufferedReader . * I found that read() is about 10x slower than readLine() . Is this expected? Or am I doing something wrong? Here's a benchmark with Java 7. The input test file has about 5 million lines and 254 million characters (~242 MB) **: The read() method takes about 7000 ms to read all the characters: @Test public void testRead() throws IOException, UnindexableFastaFileException{ BufferedReader fa= new