BufferedReader in Java Does readline() put the entire file in memory?
•
Java
Yes? Or maybe only a single string is placed on each readLine (), and the maximum memory space is the volume of the longest string?
Solution
No,
No,
No,
This is a buffer for readers This means that it has a buffer It fills the buffer to reach the range of available data and its own limit, i.e. 4096 characters It scans the buffer for line terminators; Return the data as the next line; And delete it from the buffer When the buffer is empty, it fills it again
The effect of the caller on each readLine () result depends on the caller
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码