Android 5.0+ InputStream.read限制为2048字节

时间:2015-09-10 02:59:25

标签: inputstream

我已将缓冲区大小设置为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);
}

0 个答案:

没有答案