我已将缓冲区大小设置为2M,但结果为" read.length:"在Android 5.0+上始终< = 2048。为什么呢?
is = connection.getInputStream();
byte[] buffer = new byte[1024 * 1024 * 2];
int length = -1;
while ((length = is.read(buffer)) != -1) {
Log.d("read.length:"+length);
}