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
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.
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.