Java 的 BufferedReader.readLine() 是否将整个文件放入内存?

Does Java's BufferedReader.readLine() put the whole file in memory?

是吗?或者可能只在每个 readline() 上放置单独的字符串,并且占用的最大 space 内存是最长字符串的体积?

Does it?

没有

Or maybe only separate strings are put on each readline()

没有

and maximal space of memory taken is volume for the longest string?

没有

这是一个缓冲 reader。这意味着它有一个缓冲区。它填充缓冲区,达到可用数据的范围和它自己的限制,即或曾经是 4096 个字符。它扫描缓冲区以查找行终止符; returns 之前的数据为下一行;并将其从缓冲区中删除。当缓冲区为空时,它会再次填充它。

调用者如何处理每个 readLine() 结果由调用者决定。