Dalvik message - Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required

后端 未结 2 1510
-上瘾入骨i
-上瘾入骨i 2020-12-28 19:51

When I used BufferedInputStream and I specify a buffer size, Dalvik gives me this warning - Default buffer size used in BufferedInputStream constructor. It would be better t

2条回答
  •  孤城傲影
    2020-12-28 20:26

    Just use:

    BufferedReader br = new BufferedReader(new InputStreamReader(is), 8192);
    

    instead of:

    BufferedReader br = new BufferedReader(new InputStreamReader(is));
    

    Note:

    8192 (8k) is the size of the buffer in characters.

提交回复
热议问题