InputStream#read(byte b[], int off, int len) 会返回 0 ,除了 byte 数组的长度 等于 0 的情况
off = len
没看懂你具体要解决的问题
这个是源码的注释 @return the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
就是这个方法 除了off≠len,len>0的情况下,可能会返回0吗