Why is the default char buffer size of BufferedReader 8192?

前端 未结 4 1731
隐瞒了意图╮
隐瞒了意图╮ 2020-12-10 07:52

When I construct a new BufferedReader it is providing me a buffer of 8192 characters. What is the logic/reason behind this?

8192 = 2 to the powe         


        
4条回答
  •  Happy的楠姐
    2020-12-10 08:36

    As the BufferedReader Javadoc says

    The buffer size may be specified, or the default size may be used. The default is large enough for most purposes.

    The default was chosen as being "large enough" (which I would interpret as "good enough").

提交回复
热议问题