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

后端 未结 2 1524
-上瘾入骨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:14

    You're not doing anything wrong. It's just informing you that you chose the version of the BufferedInputStream that doesn't take the size argument. If you use the other one (BufferedInputStream(InputStream in, int size)), then you can specify your own buffer size.

    You can choose to ignore the warning if 8KB happens to be exactly what you need, or you can adjust the size with the constructor to tailor it to your needs - as small as possible, as big as necessary.

提交回复
热议问题